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

ImportError: cannot import name 'deform_conv_cuda' #96

Closed
dongxijia opened this issue Sep 6, 2019 · 8 comments
Closed

ImportError: cannot import name 'deform_conv_cuda' #96

dongxijia opened this issue Sep 6, 2019 · 8 comments

Comments

@dongxijia
Copy link

When I run the test_Vid4_REDS4_with_GT.py, I got the importError.

`Traceback (most recent call last):
File "/home/EDVR/codes/models/archs/EDVR_arch.py", line 8, in
from models.archs.dcn.deform_conv import ModulatedDeformConvPack as DCN
File "/home/EDVR/codes/models/archs/dcn/init.py", line 1, in
from .deform_conv import (DeformConv, DeformConvPack, ModulatedDeformConv, ModulatedDeformConvPack,
File "/home/EDVR/codes/models/archs/dcn/deform_conv.py", line 10, in
from . import deform_conv_cuda
ImportError: cannot import name 'deform_conv_cuda'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/EDVR/codes/test_EDVR_REDS_SR_L.py", line 16, in
import models.archs.EDVR_arch as EDVR_arch
File "/home/EDVR/codes/models/archs/EDVR_arch.py", line 10, in
raise ImportError('Failed to import DCNv2 module.')
ImportError: Failed to import DCNv2 module.`

My configuration as below:
python 3.5
Pytorch 1.0
GCC 5.4.0
CUDA 8.0

what should I do to handle the error? thanks in advance.

@xinntao
Copy link
Owner

xinntao commented Sep 6, 2019

Did you compile the dcn model before running?

@dongxijia
Copy link
Author

Did you compile the dcn model before running?

Thanks for your reply.
I can only find the make.sh in the DCN_v2 code, is there any other pre-steps?

@jkoubele
Copy link

jkoubele commented Sep 9, 2019

I have the same problem. The issue is that the file codes/models/archs/dcn/deform_conv_cuda is missing.
I run setup.py in codes/models/archs/dcn (both install and build) that maybe should create it, but it didnt help.

@xinntao
Copy link
Owner

xinntao commented Sep 9, 2019

cd ./codes/models/archs/dcn
python setup.py develop

Does this command not create the deform_conv_cuda.xxxxx.so file?

@jkoubele
Copy link

jkoubele commented Sep 9, 2019

cd ./codes/models/archs/dcn
python setup.py develop

Does this command not create the deform_conv_cuda.xxxxx.so file?

That helped, thanks!
(I was running only setup.py install and build, which seemed to be the option after I run setup.py --help, didnt know I can / should run setup.py develop)

@dongxijia
Copy link
Author

Thanks a lot! The command python setup.py develop helps !

@xmengli
Copy link

xmengli commented Nov 13, 2019

cd ./codes/models/archs/dcn
python setup.py develop

Does this command not create the deform_conv_cuda.xxxxx.so file?

This helps!

@Atom-Jinny
Copy link

when I run the python setup.py develop
I found a new error
RuntimeError: Error compiling objects for extension
torch/utils/cpp_extension.py", line 1436, in _run_ninja_build raise RuntimeError(message) RuntimeError: Error compiling objects for extension

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

5 participants