SysCV / shift-dev

SHIFT Dataset DevKit - CVPR2022
https://www.vis.xyz/shift
MIT License
103 stars 10 forks source link

zip to hdf5 error #10

Closed Alexbeast-CN closed 2 years ago

Alexbeast-CN commented 2 years ago

I got the following error while tring to convert the .zip to .hdf5 using

python -m shift_dev.io.to_hdf5 "/home/tim/AD_models/SHIFT_Dataset/SHIFT/*.zip" -j 1

The error says:

Traceback (most recent call last):
  File "/home/tim/anaconda3/envs/SHIFT/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/tim/anaconda3/envs/SHIFT/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/tim/AD_models/SHIFT_Dataset/shift-dev/shift_dev/io/to_hdf5.py", line 12, in <module>
    from ..utils.storage import ZipArchiveReader
  File "/home/tim/AD_models/SHIFT_Dataset/shift-dev/shift_dev/utils/storage.py", line 8, in <module>
    from pycocotools import mask as mask_utils  # type: ignore
  File "/home/tim/anaconda3/envs/SHIFT/lib/python3.8/site-packages/pycocotools/mask.py", line 3, in <module>
    import pycocotools._mask as _mask
  File "pycocotools/_mask.pyx", line 1, in init pycocotools._mask
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
suniique commented 2 years ago

Hey @Alexbeast-CN! I have tried but I could not reproduce this error on my side. The problem looks like a version compatibility issue with Numpy and Pycocotools. Did you have any issue when running import pycocotools._mask alone? If so, perhaps you need to install pycocotools manually. This post (https://github.com/cocodataset/cocoapi/issues/248) may be helpful.

Alexbeast-CN commented 2 years ago

Thank you for your reply. After reinstall pycocotools using the following command, it works!

pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI