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

Pycocotools incompatable with numpy 1.18 #1260

Closed
glenn-jocher opened this issue May 18, 2020 · 1 comment
Closed

Pycocotools incompatable with numpy 1.18 #1260

glenn-jocher opened this issue May 18, 2020 · 1 comment

Comments

@glenn-jocher
Copy link

Google Colab with pycocotools preinstalled and numpy 1.18.4 preinstalled produces this error:

loading annotations into memory...
Done (t=0.38s)
creating index...
index created!
Loading and preparing results...
DONE (t=5.31s)
creating index...
index created!
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 117, in linspace
    num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 257, in <module>
    opt.augment)
  File "test.py", line 214, in test
    cocoEval = COCOeval(cocoGt, cocoDt, 'bbox')
  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 527, in __init__
    self.setDetParams()
  File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 507, in setDetParams
    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.

See cocodataset/cocoapi#354

@metrizable
Copy link
Contributor

@glenn-jocher Thanks for reporting the issue. We've upgraded both numpy and pycocotools versions that are pre-installed in the Colab runtime since then. If you are still experiencing an error, please open a new issue with a minimal reproducible notebook.

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