-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Errors #832
Comments
it only works with model_trainer.trainModel(num_experiments=200, batch_size=32) if I remove num_objects=10 enhance_data=True show_network_summary=True |
TypeError: ClassificationModelTrainer.trainModel() got an unexpected keyword argument 'num_objects' This error happens when you have a missmatch on number of class you have on your label data vs what you are telling the trainModel you are expecting. for example, you may have 5 annotation types for class, but on your num_objects is set to 10 |
Hello,
I tried training image recognition AI using the code:
from imageai.Classification.Custom import ClassificationModelTrainer
model_trainer = ClassificationModelTrainer()
model_trainer.setModelTypeAsResNet50()
model_trainer.setDataDirectory("idenprof")
model_trainer.trainModel(num_objects=10, num_experiments=200, enhance_data=True, batch_size=32, show_network_summary=True)
Received there errors:
C:\Users\Optiplex3070\anaconda3\python.exe "C:\Users\Optiplex3070\Downloads\python training\idenprof-jpg\FirstTraining.py"
C:\Users\Optiplex3070\AppData\Roaming\Python\Python311\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
warnings.warn(
C:\Users\Optiplex3070\AppData\Roaming\Python\Python311\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or
None
for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passingweights=None
.warnings.warn(msg)
C:\Users\Optiplex3070\AppData\Roaming\Python\Python311\site-packages\torchvision\models\inception.py:43: FutureWarning: The default weight initialization of inception_v3 will be changed in future releases of torchvision. If you wish to keep the old behavior (which leads to long initialization times due to scipy/scipy#11299), please set init_weights=True.
warnings.warn(
Traceback (most recent call last):
File "C:\Users\Optiplex3070\Downloads\python training\idenprof-jpg\FirstTraining.py", line 6, in
model_trainer.trainModel(num_objects=10, num_experiments=200, enhance_data=True, batch_size=32, show_network_summary=True)
TypeError: ClassificationModelTrainer.trainModel() got an unexpected keyword argument 'num_objects'
The text was updated successfully, but these errors were encountered: