Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make.sh error on pytorch1.0 #402

Closed
wanghan0501 opened this issue Dec 19, 2018 · 4 comments
Closed

make.sh error on pytorch1.0 #402

wanghan0501 opened this issue Dec 19, 2018 · 4 comments

Comments

@wanghan0501
Copy link

running build_ext
copying build/lib.linux-x86_64-3.7/model/_C.cpython-37m-x86_64-linux-gnu.so -> model
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 "/root/.pyenv/versions/3.7.1/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 "/root/.pyenv/versions/3.7.1/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 "/root/.pyenv/versions/3.7.1/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 "/root/.pyenv/versions/3.7.1/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.

when I run sh maske.sh, I got the error message as shown above.

@jwyang
Copy link
Owner

jwyang commented Dec 19, 2018

@wanghan0501 I guess you are still using pytorch 0.4 (master) branch, please go to pytorch-1.0 branch and try again.

@wanghan0501
Copy link
Author

I find the reason that I got error message. You should remove make.sh in branch pytorch-1.0, and I also find you didn't compile coco api, which will lead to a error.

You shoud add setup file in pycocotools

# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------

import os
from setuptools import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np


# Obtain the numpy include directory.  This logic works across numpy versions.
try:
    numpy_include = np.get_include()
except AttributeError:
    numpy_include = np.get_numpy_include()


ext_modules = [
    Extension(
        '_mask',
        sources=['maskApi.c', '_mask.pyx'],
        include_dirs = [numpy_include, '.'],
        extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'],
    )
]

setup(
    name='faster_rcnn',
    ext_modules=ext_modules,
    # inject our custom trigger
    cmdclass={'build_ext': build_ext},
)

and run

python setup.py build_ext --inplace

@jwyang
Copy link
Owner

jwyang commented Dec 19, 2018

thanks! In pytorch-1.0 branch, I already removed sh make.sh for the installation, will remove the file as well. The compiled pycocotools file in pytorch-0.4.0 is reusable and thus I did not compile here. Thanks for reminding.

@devendraswamy
Copy link

so there no need to run "sh make.sh" ? or is it necessary to run ??
please help me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants