Skip to content

ERROR using numpy with version >=1.18 #177

@guihuzhang

Description

@guihuzhang

an error appeared when I use numpy 1.18 for this code:

Traceback (most recent call last):
File "tools/train.py", line 210, in
main()
File "tools/train.py", line 180, in main
final_output_dir, tb_log_dir
File "deep-high-resolution-net.pytorch/tools/../lib/core/function.py", line 200, in validate
filenames, imgnums
File "deep-high-resolution-net.pytorch/tools/../lib/dataset/coco.py", line 362, in evaluate
res_file, res_folder)
File "deep-high-resolution-net.pytorch/tools/../lib/dataset/coco.py", line 433, in _do_python_keypoint_eval
coco_eval = COCOeval(self.coco, coco_dt, 'keypoints')
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 76, in init
self.params = Params(iouType=iouType) # parameters
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 529, in init
self.setKpParams()
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 518, in setKpParams
self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
File "<array_function internals>", line 6, in linspace
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 121, in linspace
.format(type(num)))
TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.

because linspace function is no more supported in 1.18.
after I uninstalled numpy 1.18 and installed numpy 1.17, it works well.

the code works well if the numpy version requirements.txt is fixed as numpy==1.17

Metadata

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