RFCN_CoupleNet.pytorch
RFCN_CoupleNet.pytorch copied to clipboard
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
os: ubuntu18.04 python:3.7 CUDA:10.0 cuDNN: 7.6 pytorch: 1.2
Hi, when I execute the command:
sh make.sh
I got errors:
error: command 'gcc' failed with exit status 1
rm: cannot remove 'model/nms/src/*.o': No such file or directory
rm: cannot remove 'model/roi_pooling/src/*.o': No such file or directory
rm: cannot remove 'model/roi_align/src/*.o': No such file or directory
rm: cannot remove 'model/roi_crop/src/*.o': No such file or directory
rm: cannot remove 'model/psroi_pooling/src/cuda/*.o': No such file or directory
Compiling nms kernels by nvcc...
Traceback (most recent call last):
File "build.py", line 4, in <module>
from torch.utils.ffi import create_extension
File "/media/gaoya/disk/Applications/anaconda3/lib/python3.7/site-packages/torch/utils/ffi/__init__.py", line 1, in <module>
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
Compiling roi pooling kernels by nvcc...
Traceback (most recent call last):
File "build.py", line 4, in <module>
from torch.utils.ffi import create_extension
File "/media/gaoya/disk/Applications/anaconda3/lib/python3.7/site-packages/torch/utils/ffi/__init__.py", line 1, in <module>
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
Compiling roi align kernels by nvcc...
Traceback (most recent call last):
File "build.py", line 4, in <module>
from torch.utils.ffi import create_extension
File "/media/gaoya/disk/Applications/anaconda3/lib/python3.7/site-packages/torch/utils/ffi/__init__.py", line 1, in <module>
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
Compiling roi crop kernels by nvcc...
Traceback (most recent call last):
File "build.py", line 4, in <module>
from torch.utils.ffi import create_extension
File "/media/gaoya/disk/Applications/anaconda3/lib/python3.7/site-packages/torch/utils/ffi/__init__.py", line 1, in <module>
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
Compiling psroi pooling kernels by nvcc...
Traceback (most recent call last):
File "build.py", line 3, in <module>
from torch.utils.ffi import create_extension
File "/media/gaoya/disk/Applications/anaconda3/lib/python3.7/site-packages/torch/utils/ffi/__init__.py", line 1, in <module>
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
Can someone tell me how can I fix this problem?
@ouening Using pytorch 0.3.1 will fix this.
@ouening Using pytorch 0.3.1 will fix this.
Yeah I know downgrading to 0.4 can fix it , but it's not the best solution. I think we should modify the file build.py in lib/model/nms,lib/model/roi-align and so on.
From the solution in https://blog.csdn.net/ShuqiaoS/article/details/88420326 :
change
from torch.utils.ffi import create_extension
to
from torch.utils.cpp_extension import BuildExtension
and change
ffi = create_extension(...) to ffi = BuildExtension(...)
but other errors happened! I have no knowledge of cuda ,pytorch extension and write a build file, so hope someone can fix this problem
Is there someone who fixed this???