"python build.py" not surport on pytorch1.0.1
VincentGogo opened this issue · 7 comments
Traceback (most recent call last):
File "build.py", line 3, in
from torch.utils.ffi import create_extension
File "D:\Dev\Anaconda3\envs\keras\lib\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.
I have the same problem. Have u solved it?
same here
same here
Found a workaround: There is a nice lib https://github.com/facebookresearch/maskrcnn-benchmark/tree/master/maskrcnn_benchmark -- they ported everything to latest Cuda and pytorch17.04.2019, 15:36, "EunSeop Shin" notifications@github.com:same here —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
Thankyou so much :)
Hello Sir.
I met same problems. I use pytorch 1.1.0.
Traceback (most recent call last):
File "build.py", line 3, in
from torch.utils.ffi import create_extension
File "/usr/local/lib/python3.5/dist-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.
How to solve it??
Thanks.
I modified source code.
But I met some error.
def get_extensions():
sources = ['src/nms.c']
headers = ['src/nms.h']
extra_compile_args = {"cxx": []}
define_macros = []
if (torch.cuda.is_available() and CUDA_HOME is not None) or os.getenv("FORCE_CUDA", "0") == "1":
extension = CUDAExtension
sources += ['src/nms_cuda.c']
headers += ['src/nms_cuda.h']
#sources += source_cuda
define_macros += [("WITH_CUDA", None)]
extra_compile_args["nvcc"] = [
"-DCUDA_HAS_FP16=1",
"-D__CUDA_NO_HALF_OPERATORS__",
"-D__CUDA_NO_HALF_CONVERSIONS__",
"-D__CUDA_NO_HALF2_OPERATORS__",
]
include_dirs = ['./']
ext_modules = [
extension(
"_ext.nms",
sources,
include_dirs=include_dirs,
define_macros=define_macros,
extra_compile_args=extra_compile_args,
)
]
return ext_modules
How to solve it??