kimyoon-young / centerNet-deep-sort

realtime multiple people tracking (centerNet based person detector + deep sort algorithm with pytorch)
GNU General Public License v3.0
592 stars 148 forks source link

ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead. #20

Open clemente0731 opened 4 years ago

clemente0731 commented 4 years ago

python demo_centernet_deepsort.py

then i got these ~

<module 'sys' (built-in)> Traceback (most recent call last): File "demo_centernet_deepsort.py", line 10, in from detectors.detector_factory import detector_factory File "/home/joe/Desktop/centerNet-deep-sort/CenterNet/src/lib/detectors/detector_factory.py", line 5, in from .exdet import ExdetDetector File "/home/joe/Desktop/centerNet-deep-sort/CenterNet/src/lib/detectors/exdet.py", line 26, in from .base_detector import BaseDetector File "/home/joe/Desktop/centerNet-deep-sort/CenterNet/src/lib/detectors/base_detector.py", line 11, in from models.model import create_model, load_model File "/home/joe/Desktop/centerNet-deep-sort/CenterNet/src/lib/models/model.py", line 12, in from .networks.pose_dla_dcn import get_pose_net as get_dla_dcn File "/home/joe/Desktop/centerNet-deep-sort/CenterNet/src/lib/models/networks/pose_dla_dcn.py", line 16, in from .DCNv2.dcn_v2 import DCN File "/home/joe/Desktop/centerNet-deep-sort/CenterNet/src/lib/models/networks/DCNv2/dcn_v2.py", line 11, in from .dcn_v2_func import DCNv2Function File "/home/joe/Desktop/centerNet-deep-sort/CenterNet/src/lib/models/networks/DCNv2/dcn_v2_func.py", line 9, in from ._ext import dcn_v2 as _backend File "/home/joe/Desktop/centerNet-deep-sort/CenterNet/src/lib/models/networks/DCNv2/_ext/dcn_v2/init.py", line 2, in from torch.utils.ffi import _wrap_function File "/home/joe/anaconda3/envs/CenterNet_test/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 1, in raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.") ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.

Ujang24 commented 4 years ago

you can check the answer from this comment: https://github.com/pytorch/pytorch/issues/15645 The main idea is to downgrade the pytorch version into 0.4.1 What solve my problem is: pip3 install torch==0.4.1 torchvision==0.2.1

zldrobit commented 4 years ago

You can upgrade CenterNet to work with Pytorch 1.0+ using CenterNet works ok on Pytorch 1.1 + Cuda10.1 + Win10