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

Running model with torch 1.x #9

Open
SynStratos opened this issue Sep 13, 2020 · 6 comments
Open

Running model with torch 1.x #9

SynStratos opened this issue Sep 13, 2020 · 6 comments

Comments

@SynStratos
Copy link

Hi,
could you suggest a solution to run the evaluation with pytorch 1? I would like to try it on Colab but installing torch 0.4.1 generates problem with Cuda so it is a bit problematic.

The main problem is related to the libs modules but I can't find a complete solution to it :(

@ziwei-zh
Copy link
Owner

ziwei-zh commented Sep 15, 2020

Hi, I have not tested it on pytorch1, but you can refer to the following line in CE2P repo (https://github.com/liutinglt/CE2P):

to use Pytorch 1.0, just replace 'libs' with 'modules' in https://github.com/mapillary/inplace_abn, and rename it to 'libs'.

@SynStratos
Copy link
Author

Yep, I tried to do so but doesn't solve the missing _wrap_function in the lib/_ext init :(
Do you have any idea what could be the correct substitute?

@ziwei-zh
Copy link
Owner

Could you show the errors?

@BLOO69
Copy link

BLOO69 commented Oct 28, 2020

Hi, I believe this is the same error.

Traceback (most recent call last):
File "evaluate.py", line 13, in
from networks.model import CorrPM_Model
File "/home/student/Documents/CorrPM/networks/model.py", line 7, in
from networks.non_local import NONLocalBlock2D
File "/home/student/Documents/CorrPM/networks/non_local.py", line 7, in
from libs import InPlaceABN, InPlaceABNSync
File "/home/student/Documents/CorrPM/libs/init.py", line 1, in
from .bn import ABN, InPlaceABN, InPlaceABNWrapper, InPlaceABNSync, InPlaceABNSyncWrapper
File "/home/student/Documents/CorrPM/libs/bn.py", line 15, in
from .functions import inplace_abn, inplace_abn_sync
File "/home/student/Documents/CorrPM/libs/functions.py", line 5, in
from . import _ext
File "/home/student/Documents/CorrPM/libs/_ext/init.py", line 2, in
from torch.utils.ffi import _wrap_function
File "/home/student/anaconda3/envs/CORR/lib/python3.6/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.

Dependecies

Pytorch == 1.7.0
CUDA == 10.2.89
CUDNN == 7.6.5_0

When i run nvcc: CUDA == 10.2.89
When i print torch.cuda.is_available() = True

Analysis

It seems that this error is specific for pytorch versions above 0.4.1. How would i be able to use this repo successfully?

If i try to install the dependencies based on environment.yaml:
Traceback (most recent call last):
File "evaluate.py", line 13, in
from networks.model import CorrPM_Model
File "/home/student/Documents/CorrPM/networks/model.py", line 7, in
from networks.non_local import NONLocalBlock2D
File "/home/student/Documents/CorrPM/networks/non_local.py", line 7, in
from libs import InPlaceABN, InPlaceABNSync
File "/home/student/Documents/CorrPM/libs/init.py", line 1, in
from .bn import ABN, InPlaceABN, InPlaceABNWrapper, InPlaceABNSync, InPlaceABNSyncWrapper
File "/home/student/Documents/CorrPM/libs/bn.py", line 15, in
from .functions import inplace_abn, inplace_abn_sync
File "/home/student/Documents/CorrPM/libs/functions.py", line 5, in
from . import _ext
File "/home/student/Documents/CorrPM/libs/_ext/init.py", line 3, in
from .__ext import lib as _lib, ffi as _ffi
ImportError: /home/student/Documents/CorrPM/libs/_ext/__ext.so: undefined symbol: __cudaRegisterFatBinaryEnd

This is most likely due to the CUDA = 9.0. I appreciate your help!

@xinzi2018
Copy link

i have the same questions

@Deepak2405
Copy link

Is this issue solved? I am having same error

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