Jumabek / darknet_scripts

Auxilary scripts to work with (YOLO) darknet deep learning famework. AKA -> How to generate YOLO anchors?
223 stars 96 forks source link

The code is not compatible with Python 3.x #16

Open MyVanitar opened 6 years ago

MyVanitar commented 6 years ago

Hi,

You have wrote the code in Python 2 and it is obvious from the print without parenthesis in the code. But in the description you mentioned about installing the python 3.5.

The code works with Python 2.7, but it does not work with Python 3.6.4 as I tested now, even after I modified the ( and ) for print operations.

Error:

Traceback (most recent call last):
  File "gen_anchors.py", line 165, in <module>
    main(sys.argv)
  File "gen_anchors.py", line 161, in main
    kmeans(annotation_dims,centroids,eps,anchor_file)
  File "gen_anchors.py", line 74, in kmeans
    k,dim = centroids.shape
ValueError: not enough values to unpack (expected 2, got 1)

Please fix.

Jumabek commented 6 years ago

Hi @VanitarNordic , I changed it to python2 from the manual. Thanks for the catch!