-
-
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
AssertionError while generating anchors #807
Comments
A similar problem |
A small random change in the width and height fields helped me. Previously, I set the constant numbers as field data, and this error occurred. |
i have same problem. how to fix it |
As I empirically understood, such an error is related to the uniformity of input parameters, whether width or height, that interfere with successful learning. On my part, I personally generated a constant height and width, which is why I always got this error. The solution for me was a small randomization of width and height, literally by ~0.01 values. |
Hi,
I´m training a volov3 using a custom dataset and ran into the error where an assertion is triggered. I´m using the same code with another dataset without any problems so I asume, I made an error creating this dataset. Does anybody know what type of mistakes in a dataset could trigger the shown assertion. Until now I couldn´t find any differences in the annotation files of the two datasets.
All annotation files are generated by a self written script. The following example shows one of the files:
Traceback (most recent call last):
File "C:\Users\jonas\OneDrive\Hochschule\Master\Master Arbeit\Python\testFramework\yolo.py", line 86, in
y.train(dataDirectory="syntheticDataset/temp/out", baseModelPath="syntheticDataset/yolov3.pt")
File "C:\Users\jonas\OneDrive\Hochschule\Master\Master Arbeit\Python\testFramework\yolo.py", line 80, in train
trainer.trainModel()
File "C:\Users\jonas\AppData\Roaming\Python\Python311\site-packages\imageai\Detection\Custom_init_.py", line 229, in trainModel
self.__set_training_param(self._epochs, accumulate)
File "C:\Users\jonas\AppData\Roaming\Python\Python311\site-packages\imageai\Detection\Custom_init.py", line 62, in __set_training_param
self.__anchors = generate_anchors(
^^^^^^^^^^^^^^^^^
File "C:\Users\jonas\AppData\Roaming\Python\Python311\site-packages\imageai\Detection\Custom\yolo\custom_anchors.py", line 59, in generate_anchors
assert len(k) == n, f'ERROR: scipy.cluster.vq.kmeans requested {n} points but returned only {len(k)}'
^^^^^^^^^^^
AssertionError: ERROR: scipy.cluster.vq.kmeans requested 9 points but returned only 7
The text was updated successfully, but these errors were encountered: