multimodallearning / pytorch-mask-rcnn

Other
2.01k stars 557 forks source link

"python build.py" not surport on pytorch1.0.1 #73

Open VincentGogo opened 5 years ago

VincentGogo commented 5 years ago

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.

xuzheyuan624 commented 5 years ago

I have the same problem. Have u solved it?

vivanov879 commented 5 years ago

same here

kairos03 commented 5 years ago

same here

vivanov879 commented 5 years ago

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.

kairos03 commented 5 years ago

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 :)

edwardcho commented 4 years ago

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.

edwardcho commented 4 years ago

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??