Open Jefflier opened 5 years ago
Kindly note that transfer learning using TinyYOLOv3 is not supported. Use the pre-trained YOLOv3 model in the training essentials release.
https://github.com/OlafenwaMoses/ImageAI/releases/tag/essential-v4
Thanks,l will change it and try again!
Hello please see an urgent bug fix update here #278
In CustomVideoObjectDetection,it seems that video_detector.loadModel() don't have detection_speed.
Not yet. It will be added later.
I have a similar issue. This is my code:
from imageai.Detection.Custom import DetectionModelTrainer trainer = DetectionModelTrainer() trainer.setModelTypeAsYOLOv3() trainer.setDataDirectory(data_directory="dataset") trainer.setTrainConfig(object_names_array=["Apple", "Orange"], batch_size=4, num_experiments=10, train_from_pretrained_model="pretrained-yolov3.h5") trainer.trainModel()
and this is my issue:
Using TensorFlow backend.
Generating anchor boxes for training images and annotation...
Traceback (most recent call last):
File "TrainModel.py", line 9, in
I already update to the latest version of imageai 5 minutes ago. Is anybody has a solution for this?
just check your label file, is there some .xml file get width or height that equals to zero
Thank Jefflier!
I already checked with the command: grep -r "
not only the label file,but also the images
@tiensu Since there are some labels with width and height equals "0", you must remove the labels and their corresponding images from the dataset.
Hi OlafenwaMoses! I did as below:
I am getting zerodivision error at the line " relative_w = (float(obj['xmax']) - float(obj['xmin']))/image['width']". Checked the images and annotations but could not find the problem. Can you please help me to resolve this? Error given below:
ZeroDivisionError Traceback (most recent call last)
With the command grep -r "width>0"
I figure out the problem: it was my webp
images that generate annotations with 0 widths and heights. I converted all the webp
to jpg
and fixed all the annotations with the correct width and height using a python script.
After that, the error keeps occurring. In my case, the reason is that ImageAI uses some caching. 3 folders are generated: cache
, models
and json
. I deleted all three folders, and with the corrected annotations, everything works fine.
Not sure, but maybe just deleting the cache
folder would be enough.
when l trained model,an error occured. Using TensorFlow backend. Generating anchor boxes for training images and annotation... Traceback (most recent call last): File "/content/drive/My Drive/APP/dh/as.py", line 6, in
trainer.setTrainConfig(object_names_array=["battery"], batch_size=4, num_experiments=20,train_from_pretrained_model="/content/drive/My Drive/APP/dh/yolo-tiny.h5")
File "/usr/local/lib/python3.6/dist-packages/imageai/Detection/Custom/init.py", line 162, in setTrainConfig
self.train_cache_file, self.model_labels)
File "/usr/local/lib/python3.6/dist-packages/imageai/Detection/Custom/gen_anchors.py", line 89, in generateAnchors
relative_w = (float(obj['xmax']) - float(obj['xmin']))/image['width']
ZeroDivisionError: float division by zero