open-mmlab / mmpose

OpenMMLab Pose Estimation Toolbox and Benchmark.
https://mmpose.readthedocs.io/en/latest/
Apache License 2.0
5.92k stars 1.26k forks source link

Training error in docker: ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject #534

Closed christian-git-md closed 3 years ago

christian-git-md commented 3 years ago

I built and ran the docker image as described here. I tried to run the training command for single gpu as described in the docs, so python train.py configs/bottom_up/resnet/coco/res50_coco_640x640.py

This gave me the following error:

Traceback (most recent call last):
  File "tools/train.py", line 14, in <module>
    from mmpose.apis import train_model
  File "/mmpose/mmpose/apis/__init__.py", line 1, in <module>
    from .inference import (inference_bottom_up_pose_model,
  File "/mmpose/mmpose/apis/inference.py", line 10, in <module>
    from mmpose.datasets.pipelines import Compose
  File "/mmpose/mmpose/datasets/__init__.py", line 2, in <module>
    from .datasets import (BottomUpCocoDataset, BottomUpCrowdPoseDataset,
  File "/mmpose/mmpose/datasets/datasets/__init__.py", line 1, in <module>
    from ...deprecated import (TopDownFreiHandDataset, TopDownOneHand10KDataset,
  File "/mmpose/mmpose/deprecated.py", line 2, in <module>
    from .datasets.datasets.top_down.topdown_base_dataset import TopDownBaseDataset
  File "/mmpose/mmpose/datasets/datasets/top_down/__init__.py", line 1, in <module>
    from .topdown_aic_dataset import TopDownAicDataset
  File "/mmpose/mmpose/datasets/datasets/top_down/topdown_aic_dataset.py", line 4, in <module>
    from xtcocotools.coco import COCO
  File "/opt/conda/lib/python3.7/site-packages/xtcocotools/coco.py", line 59, in <module>
    from . import mask as maskUtils
  File "/opt/conda/lib/python3.7/site-packages/xtcocotools/mask.py", line 3, in <module>
    import xtcocotools._mask as _mask
  File "xtcocotools/_mask.pyx", line 1, in init xtcocotools._mask
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

Host OS: Ubuntu 16.04 Docker Engine: 20.10.2

Gwang-chae commented 3 years ago

@christian-git-md Hello. I got the same error message... Even a few days ago, my code worked on Colab!! In my case, it was solved by changing numpy version 1.19.5 to 1.20.0

innerlee commented 3 years ago

It is likely to be a numpy issue. Try to reinstall numpy or upgrade it to the latest version.

ioctl-user commented 3 years ago

Is it possible to write good numpy version in the requirements file to avoid this problems?

wangm-word commented 3 years ago

when i run python top_down_img_demo_with_mmdet.py ./dete_cig/faster_rcnn_r50_fpn_1x_coco.py ./dete_cig/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth ./configs/top_down/lite_hrnet/coco/litehrnet_18_coco_256x192.py ./checkpoints/litehrnet_18_coco_256x192.pth --img-root ./test --json-file ./data/coco/person_detection_results/COCO_val2017_detections_AP_H_56_person.json --out-img-root ./res

image can you tell me how about this @innerlee

459737087 commented 2 years ago

Hello! I also met this problem, numpy 1.21.2

jin-s13 commented 2 years ago

Please upgrade the version of pip and numpy.

124451 commented 2 years ago

pip install --upgrade numpy

459737087 commented 2 years ago

Thank you !! I install numpy version 1.22.0 But when numpy upgrade ,maybe I should upgrade numpy.

AshwiniR97 commented 1 year ago

I still have the same issue. Can someone tell me which version of numpy should I actually be using to avoid this error? I've tried 1.21 and 1.22, both continue to give me the same error.