-
Notifications
You must be signed in to change notification settings - Fork 242
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
Replace deprecated NumPy aliases with builtin types #117
base: master
Are you sure you want to change the base?
Conversation
The problem here is that |
I see. However the use of these aliases is not consistent throughout TrackEval and this PR addresses this issue, unifying the approach (there are multiple places in which Python types were already used). What is more, for those who use TrackEval without the functionalities of pycocotools (myself included), this allows to use newer versions of NumPy as well. One way would be to create a fork of pycocotools, fix the issues and switch to the fork here. This seems to be a bit of a fuss though :/ |
Yup 😞. But at some point I guess it has to be done as |
Came here looking to fix it myself because we need to update to Numpy 1.14, but then found this MR. It's not preferable to stay tied to pycocotools if they are so far behind with Numpy. Perhaps creating a fork and updating it should be the way to go. |
Also, pycocotools uses https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/cocoeval.py#L378 I fixed it for me with this hack:
Added it just before the import to |
these commands to patch from CLI worked for me
|
I went for exact this same solution @Dorozhko-Anton. It is the best option right now IMO, rather than waiting for all eternity for this to get merged 😆 |
I have edited the comment. and not the original coco: Therefore, we would just need to update the requirements to the latest |
NumPy 1.20 deprecates some of the aliases of the builtin types: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
With version 1.24 the aliases were removed; the change is necessary to keep TrackEval working with newer versions of NumPy.
I replaced
np.int
,np.float
andnp.bool
aliases with builtin types according to the table in the deprecation note.