OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.49k stars 2.18k forks source link

Empty range error! #707

Open pavi2707 opened 2 years ago

pavi2707 commented 2 years ago

Thanks for this amazing contribution! I am running this on my local machine! I get the following error

File "C:\Users\pavit\AppData\Local\Programs\Python\Python37\lib\site-packages\imageai\Detection\Custom__init.py", line 179, in setTrainConfig self.train_cache_file, self.__model_labels) File "C:\Users\pavit\AppData\Local\Programs\Python\Python37\lib\site-packages\imageai\Detection\Custom\gen_anchors.py", line 95, in generateAnchors centroids = run_kmeans(annotation_dims, num_anchors) File "C:\Users\pavit\AppData\Local\Programs\Python\Python37\lib\site-packages\imageai\Detection\Custom\gen_anchors.py", line 44, in run_kmeans indices = [random.randrange(ann_dims.shape[0]) for i in range(anchor_num)] File "C:\Users\pavit\AppData\Local\Programs\Python\Python37\lib\site-packages\imageai\Detection\Custom\gen_anchors.py", line 44, in indices = [random.randrange(ann_dims.shape[0]) for i in range(anchor_num)] File "C:\Users\pavit\AppData\Local\Programs\Python\Python37\lib\random.py", line 190, in randrange raise ValueError("empty range for randrange()") ValueError: empty range for randrange()

ekesdf commented 2 years ago

Hi, It seems like imageai couldn't find any annotations, so it might be helpful to check your dataset path and if the annotations are correct and in the right place