Skip to content
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

ERROR using numpy with version >=1.18 #177

Open
guihuzhang opened this issue Mar 28, 2020 · 1 comment
Open

ERROR using numpy with version >=1.18 #177

guihuzhang opened this issue Mar 28, 2020 · 1 comment

Comments

@guihuzhang
Copy link

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

@dzyjjpy
Copy link

dzyjjpy commented Sep 17, 2020

I also met this issue for eval.py, try to reinstall 1.12. or 1.11, no work.
reinstall numpy==1.17, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants