ImageAI
ImageAI copied to clipboard
I am getting errors with ImageAI TypeError: object of type 'NoneType' has no len() PLEASE HELP MEEE :'(
Generating anchor boxes for training images and annotation... Average IOU for 9 anchors: 0.98 Anchor Boxes generated. Detection configuration saved in Person008/json/detection_config.json Some labels have no annotations! Please revise the list of labels in your configuration. Training on: None Training with Batch Size: 4 Number of Experiments: 100
TypeError Traceback (most recent call last)
1 frames
/usr/local/lib/python3.6/dist-packages/imageai/Detection/Custom/generator.py in init(self, instances, anchors, labels, downsample, max_box_per_image, batch_size, min_net_size, max_net_size, shuffle, jitter, norm) 34 self.net_w = 416 35 ---> 36 if shuffle: np.random.shuffle(self.instances) 37 38 def len(self):
mtrand.pyx in mtrand.RandomState.shuffle()
TypeError: object of type 'NoneType' has no len()
I am getting this error when I run
from imageai.Detection.Custom import DetectionModelTrainer
trainer = DetectionModelTrainer() trainer.setModelTypeAsYOLOv3() trainer.setDataDirectory(data_directory="Person008") trainer.setTrainConfig(object_names_array=["Person008"], batch_size=4, num_experiments=100, train_from_pretrained_model="pretrained-yolov3.h5") trainer.trainModel() help me if you need more details i'll reply to you BUT PLEASE HELP ME
Check the annotation. There may be some annotated boxes without class name "Person008" which does not match the parameter object_names_array in setTrainConfig()
First of all, make sure to be running the last version of ImageAI, otherwise upgrade it.
No training samples were read. Check if every thing is correctly set up (the path to the folders with images/annotations). Also consider double checking the annotation files.
Please, update your status on this, or close it otherwise.
I also checked my xml file. But it shows correctly. I am having latest version of imageai also. Please help me out to solve my problem.
you might have added names to your object_names_array that you didn't annotate
Yes You are right, It's Running bro, Thanks
I got this error how i can fix it. Please help me.
you might have added names to your object_names_array that you didn't annotate
My issue was solved with this, I placed the wrong object array name. Also, The imageAI functions are quite outdated as I keep getting a depreciated warning while running my programs. Does anyone know when it'll be updated!
I am also getting this error, but in my case, everything works fine when I put all files in the train folder. the error comes as soon as I move some files to the validation folder. same files if put to the train folder works fine. I am using latest version of imageai. does anyone has faced this problem?
I found the issue is due to the cache files generated "detection_test_data.pkl". If the annotation labels and images are correct, delete the cache files and try. worked for me.
you might have added names to your object_names_array that you didn't annotate
Can you elaborate above reply more..I could not understand it cleary. I am facing same error above while using yolov3 model .
i have a solve for everyone: when u work with labelimg after you do a rectangle u need name all of your labels same name and after put this name in object_names_array. I did it and it worked