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

No module named 'resample2d_package' #6

Open
Angelalgz opened this issue Jan 7, 2019 · 13 comments
Open

No module named 'resample2d_package' #6

Angelalgz opened this issue Jan 7, 2019 · 13 comments

Comments

@Angelalgz
Copy link

No description provided.

@Min-Sheng
Copy link

I also encounter this problem. Does anyone know why this is happening and how to fix it?

@phoenix104104
Copy link
Owner

Can you show the command that you encountered this problem?
Note that resampled2d needs to be compiled first by:
cd networks/resample2d_package
./make.sh

@Min-Sheng
Copy link

I found it's the same problem as Issue #4 and #5 . Just import every modules with from .xxx[module path] import XXX[module name], like from .resample2d_package.modules.resample2d import Resample2d in every python files in networks directory.

@Angelalgz
Copy link
Author

Angelalgz commented Jan 10, 2019 via email

@rodrigosilvafe
Copy link

rodrigosilvafe commented Feb 17, 2019

Thanks for all the hints.

I also have the same issue:
ModuleNotFoundError: No module named 'resample2d_package'

I used the make.sh from resample2d_package and still get the same error (this "make .sh step" is not indicated in the readme file on the code page at the github of this work)

I tried with the "import every modules with from .xxx[module path] import XXX[module name]"
All the modules of this kind that I found:

from .FlowNet2 import *
from .vgg import *
from .TransformNet import *

So I copied all of these to every py file on networks, i get:
ModuleNotFoundError: No module named 'ConvLSTM'

Then I tried with:

from .FlowNet2 import *
from .vgg import *
from .TransformNet import *
from .import FlowNetC
from .import FlowNetS
from .import FlowNetSD
from .import FlowNetFusion

So I copied all of these to every py file on networks, i get:

ModuleNotFoundError: No module named 'submodules'

Finally, I tried:

from .FlowNet2 import *
from .vgg import *
from .TransformNet import *
from .import FlowNetC
from .import FlowNetS
from .import FlowNetSD
from .import FlowNetFusion

from resample2d_package.modules.resample2d import Resample2d
from channelnorm_package.modules.channelnorm import ChannelNorm
from submodules import *
from correlation_package.modules.correlation import Correlation
from ConvLSTM import ConvLSTM
from collections import namedtuple
from torchvision import models

And get the same error at the beginning

Please note there is not "from .resample2d_package.modules.resample2d import Resample2d" module
There is without the dot at the beginning
"from resample2d_package.modules.resample2d import Resample2d"

I am working on colab, cuda 10.0, torch 0.4.0.

Any help would be very appreciated
Thanks

@rodrigosilvafe
Copy link

In the .py files at the networks folder I changed some of the imports:

from resample2d_package.modules.resample2d import Resample2d
from channelnorm_package.modules.channelnorm import ChannelNorm
from submodules import *
from ConvLSTM import ConvLSTM

Basically, I added networks. to the imports

from networks.resample2d_package.modules.resample2d import Resample2d
from networks.channelnorm_package.modules.channelnorm import ChannelNorm
from networks.submodules import *
from networks.ConvLSTM import ConvLSTM

I think this solve the problem of the import

Now I am using Cuda 9.0.176, torch 0.4.0, gcc 6.5.0 and g++ 6.5.0 (on Colab)

Now, when I use the !python test_pretrained.py -dataset DAVIS -task WCT/wave I get TypeError: a bytes-like object is required, not 'str'

Do I have to download some of the dataset? are they neccessary to work on a new video?

Thanks

@Angelalgz
Copy link
Author

Angelalgz commented Feb 27, 2019 via email

@rodrigosilvafe
Copy link

Thanks for the reply

When I use:

python test_pretrained.py -dataset DAVIS -task WCT/wave

I get:

Namespace(cuda=True, data_dir='data', dataset='DAVIS', gpu=0, list_dir='lists', phase='test', redo=False, size_multiplier=4, task='WCT/wave')
Load pretrained_models/ECCV18_blind_consistency_opts.pth
Traceback (most recent call last):
File "test_pretrained.py", line 48, in
model_opts = pickle.load(f)
TypeError: a bytes-like object is required, not 'str'

Thanks again

@Angelalgz
Copy link
Author

Angelalgz commented Feb 27, 2019 via email

@rodrigosilvafe
Copy link

Thanks, that solved the TypeError

@luhannan
Copy link

Add " sys.path.append('./networks') " before " ### custom lib " will solve the import error.
The author's environment is probably python2, which uses relative path when imports modules. However, python3 uses absolute path, which is the path of "test_pretrained.py".

@linshideng
Copy link

Add " sys.path.append('./networks') " before " ### custom lib " will solve the import error. The author's environment is probably python2, which uses relative path when imports modules. However, python3 uses absolute path, which is the path of "test_pretrained.py".

Thank you so much. it did work finally

@Ssakura-go
Copy link

Add " sys.path.append('./networks') " before " ### custom lib " will solve the import error. The author's environment is probably python2, which uses relative path when imports modules. However, python3 uses absolute path, which is the path of "test_pretrained.py".

Thank you so much. it did work finally

Hello, dear friend,
I'd like to try this model on my data, however, I couldn't get right environment it based on.
Therefore, if you are free, could you please share the env setting to 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

7 participants