Skip to content

Error in the gen_anchors.py script using Python 3.5.2 - 3.6.4 on Windows 7x64 #17

Open
@AlexeyAB

Description

Hi @Jumabek

As stated in your manual

  1. Download and install Python for Windows: https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe
  • If I use Python 2.7.14 then using gen_anchors.py I can get good result:
iter 1: dists = 3720.01823941
iter 2: dists = 1491.80522823
iter 3: dists = 653.572890569
iter 4: dists = 381.526341088
iter 5: dists = 284.587940623
iter 6: dists = 242.033800206
iter 7: dists = 155.795443854
iter 8: dists = 107.012408492
iter 9: dists = 57.3295218927
iter 10: dists = 31.8779793257
iter 11: dists = 10.0989472103
iter 12: dists = 3.2274733626
('Centroids = ', array([[0.0200242 , 0.02964734],
       [0.12974252, 0.12257372]]))
(2L, 2L)
('Anchors = ', array([[0.26031462, 0.38541545],
       [1.68665282, 1.59345842]]))
()
('centroids.shape', (2L, 2L))

  • But if I use Python 3.5.2 or Python 3.6.4 on Windows 7x64 then using gen_anchors.py I get an error:
Traceback (most recent call last):
  File "D:\Darknet2\darknet\build\darknet\x64\gen_anchors.py", line 165, in <mod
ule>
    main(sys.argv)
  File "D:\Darknet2\darknet\build\darknet\x64\gen_anchors.py", line 161, in main

    kmeans(annotation_dims,centroids,eps,anchor_file)
  File "D:\Darknet2\darknet\build\darknet\x64\gen_anchors.py", line 74, in kmean
s
    k,dim = centroids.shape
ValueError: not enough values to unpack (expected 2, got 1)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions