ClementPinard / FlowNetPytorch

Pytorch implementation of FlowNet by Dosovitskiy et al.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

importwarning:failed to load custom correlation module which is needed for FlowNetC

xuleyoung opened this issue · comments

Hi, I refer to
https://github.com/ClementPinard/Pytorch-Correlation-extension
and comment # 'correlation_cuda_kernel.cu'.
then python setup.py install
no error.
but run
python main.py

/media/data2/xly/FlowNetPytorch-master/models/util.py:11: ImportWarning: failed to load custom correlation module which is needed for FlowNetC
"which is needed for FlowNetC", ImportWarning)

Thank you for your help.

this implies that the module installation failed. If the installation module still got no errors, then maybe it's because it's not re-built

advised steps :

  • delete correlation module repo from your computer altogether
  • re-download it
  • comment the correlation_cuda_kernel.cu
  • relaunch python setup.py install
  • paste the output here
  • test the correlation module with the check.pyfile in correlation module repo

Thank you !

  • relaunch python setup.py install

  • the outputs are:

running install
running bdist_egg
running egg_info
writing Correlation_Module/spatial_correlation_sampler.egg-info/PKG-INFO
writing dependency_links to Correlation_Module/spatial_correlation_sampler.egg-info/dependency_links.txt
writing requirements to Correlation_Module/spatial_correlation_sampler.egg-info/requires.txt
writing top-level names to Correlation_Module/spatial_correlation_sampler.egg-info/top_level.txt
reading manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt'
writing manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'spatial_correlation_sampler_backend' extension
gcc -pthread -B /media/data2/xly/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/media/data2/xly/anaconda3/include/python3.7m -c Correlation_Module/correlation.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /media/data2/xly/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/media/data2/xly/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/media/data2/xly/anaconda3/include/python3.7m -c Correlation_Module/correlation_sampler.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
g++ -pthread -shared -B /media/data2/xly/anaconda3/compiler_compat -L/media/data2/xly/anaconda3/lib -Wl,-rpath=/media/data2/xly/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.7/spatial_correlation_sampler_backend.cpython-37m-x86_64-linux-gnu.so -lgomp
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-3.7/spatial_correlation_sampler_backend.cpython-37m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/spatial_correlation_sampler
copying build/lib.linux-x86_64-3.7/spatial_correlation_sampler/init.py -> build/bdist.linux-x86_64/egg/spatial_correlation_sampler
copying build/lib.linux-x86_64-3.7/spatial_correlation_sampler/spatial_correlation_sampler.py -> build/bdist.linux-x86_64/egg/spatial_correlation_sampler
byte-compiling build/bdist.linux-x86_64/egg/spatial_correlation_sampler/init.py to init.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/spatial_correlation_sampler/spatial_correlation_sampler.py to spatial_correlation_sampler.cpython-37.pyc
creating stub loader for spatial_correlation_sampler_backend.cpython-37m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/spatial_correlation_sampler_backend.py to spatial_correlation_sampler_backend.cpython-37.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying Correlation_Module/spatial_correlation_sampler.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Correlation_Module/spatial_correlation_sampler.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Correlation_Module/spatial_correlation_sampler.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Correlation_Module/spatial_correlation_sampler.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
pycache.spatial_correlation_sampler_backend.cpython-37: module references file
creating dist
creating 'dist/spatial_correlation_sampler-0.1.0-py3.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing spatial_correlation_sampler-0.1.0-py3.7-linux-x86_64.egg
removing '/media/data2/xly/anaconda3/lib/python3.7/site-packages/spatial_correlation_sampler-0.1.0-py3.7-linux-x86_64.egg' (and everything under it)
creating /media/data2/xly/anaconda3/lib/python3.7/site-packages/spatial_correlation_sampler-0.1.0-py3.7-linux-x86_64.egg
Extracting spatial_correlation_sampler-0.1.0-py3.7-linux-x86_64.egg to /media/data2/xly/anaconda3/lib/python3.7/site-packages
spatial-correlation-sampler 0.1.0 is already the active version in easy-install.pth

Installed /media/data2/xly/anaconda3/lib/python3.7/site-packages/spatial_correlation_sampler-0.1.0-py3.7-linux-x86_64.egg
Processing dependencies for spatial-correlation-sampler==0.1.0
Searching for numpy==1.16.2
Best match: numpy 1.16.2
Adding numpy 1.16.2 to easy-install.pth file
Installing f2py script to /media/data2/xly/anaconda3/bin
Installing f2py3 script to /media/data2/xly/anaconda3/bin
Installing f2py3.7 script to /media/data2/xly/anaconda3/bin

Using /media/data2/xly/anaconda3/lib/python3.7/site-packages
Searching for torch==1.0.1.post2
Best match: torch 1.0.1.post2
Adding torch 1.0.1.post2 to easy-install.pth file
Installing convert-caffe2-to-onnx script to /media/data2/xly/anaconda3/bin
Installing convert-onnx-to-caffe2 script to /media/data2/xly/anaconda3/bin

Using /media/data2/xly/anaconda3/lib/python3.7/site-packages
Finished processing dependencies for spatial-correlation-sampler==0.1.0