rowanz / neural-motifs

Code for Neural Motifs: Scene Graph Parsing with Global Context (CVPR 2018)
https://rowanzellers.com/neuralmotifs
MIT License
525 stars 115 forks source link

make libraries #70

Open parseh123 opened 5 years ago

parseh123 commented 5 years ago

Hi I used this repository in google golab, but I can not run this code and faced with this error:

%cd /content/neural-motifs/ !make

cd lib/fpn/nms; make make[1]: Entering directory '/content/neural-motifs/lib/fpn/nms' python build.py Traceback (most recent call last): File "build.py", line 3, in from torch.utils.ffi import cpp_extension ImportError: cannot import name 'cpp_extension' Makefile:2: recipe for target 'all' failed make[1]: [all] Error 1 make[1]: Leaving directory '/content/neural-motifs/lib/fpn/nms' Makefile:10: recipe for target 'nms' failed make: [nms] Error 2

Please help me!!! Thanks

rowanz commented 5 years ago

sorry I'm not sure how to use google colab. My guess is that you have a newer version of pytorch than what I used, so you would need to find a way to use the version that I used for this project.

parseh123 commented 5 years ago

Thanks. Is it possible to run this code in windows?

jungjun9150 commented 5 years ago

I recommend running the code in Linux

LifangD commented 4 years ago

Hi, I met the same problem. Have you solved?

zhangchenghua123 commented 4 years ago
    I haved solved the problem.
     First of all,  I have three versions of CUDA in /usr/local, which are 10.0,9.0, and 8.0.The default CUDA is 10.0, that is, there is a soft link from /usr/local/cuda to /usr/local/cuda-10.0
     To compile successfully, I create a new virtual environment in Anaconda.The following figure shows the installation of the virtual environment:

image So far, some error messages still appear when I execute the make command. Until I took a closer look at all the Makefile files and some of the build.py files involved, I found some code in the files: "/usr/local/cuda /bin/nvcc -c -o ......",you can use grep -rn "cuda/bin" to locate these files.I just knew that I compiled with my default CUDA, which is CUDA10.0. In all places with Makefile files, I use "make clean" to clean the generated files, and then change "/usr/local/cuda/bin" to "/usr/local/cuda-9.0/bin/nvcc" to compile successfully.