Closed roybs2 closed 5 years ago
How many pictures do you have for the test and train images for all the 4 classes?
not much, something between 5-15 How many I need?
You should have at least 500 images in each class train sub folder and 100 images in each class test sub folder . Follow the link below to read the article on this.
https://towardsdatascience.com/train-image-recognition-ai-with-5-lines-of-code-8ed0bdd8d9ba
@OlafenwaMoses you are a complete amateur wrap it!
This is really shit project.
Hey, I'm using python 3.5.4 Tensorflow version 1.11.0
I tried to do custom model training, I used your example just instead of pets I did something else but with the same hierarchy of folders. This is the code: from imageai.Prediction.Custom import ModelTraining model_trainer = ModelTraining() model_trainer.setModelTypeAsResNet() model_trainer.setDataDirectory("tables") model_trainer.trainModel(num_objects=4, num_experiments=100, enhance_data=True, batch_size=32, show_network_summary=True)
Any suggestions?
and I got this error:
Traceback (most recent call last): File "E:/Programing/Python/bills-info/AI/traingAi.py", line 5, in
model_trainer.trainModel(num_objects=4, num_experiments=100, enhance_data=True, batch_size=32, show_network_summary=True)
File "E:\Programing\Python\bills-info\env\lib\site-packages\imageai\Prediction\Custom__init__.py", line 249, in trainModel
validation_steps=int(num_test / batch_size), callbacks=[checkpoint, lr_scheduler])
File "E:\Programing\Python\bills-info\env\lib\site-packages\tensorflow\python\keras\engine\training.py", line 2065, in fit_generator
initial_epoch=initial_epoch)
File "E:\Programing\Python\bills-info\env\lib\site-packages\tensorflow\python\keras\engine\training_generator.py", line 211, in fit_generator
callbacks.on_epoch_end(epoch, epoch_logs)
File "E:\Programing\Python\bills-info\env\lib\site-packages\tensorflow\python\keras\callbacks.py", line 214, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "E:\Programing\Python\bills-info\env\lib\site-packages\tensorflow\python\keras\callbacks.py", line 568, in on_epoch_end
filepath = self.filepath.format(epoch=epoch + 1, **logs)
KeyError: 'val_acc'