relaynet_pytorch icon indicating copy to clipboard operation
relaynet_pytorch copied to clipboard

ModuleNotFoundError: No module named 'networks.relay_net'

Open gelazari opened this issue 6 years ago • 4 comments

I'm getting the following error when trying to load a pretrained model.

model = torch.load('path/to/model/relaynet_epoch20.model')

Traceback (most recent call last): File "C:\Users\gelaz\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2862, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in relaynet_model = torch.load(r'C:\Users\gelaz\PycharmProjects\VariationalOptimization\relaynet_pytorch\models\Exp01/relaynet_epoch20.model') File "C:\Users\gelaz\Anaconda3\lib\site-packages\torch\serialization.py", line 367, in load return _load(f, map_location, pickle_module) File "C:\Users\gelaz\Anaconda3\lib\site-packages\torch\serialization.py", line 538, in _load result = unpickler.load() File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.1\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import module = self._system_import(name, *args, **kwargs) ModuleNotFoundError: No module named 'networks.relay_net'

gelazari avatar Dec 18 '18 17:12 gelazari

Have you solved this problem? Today, I encountered this problem too when I used this model.

cloudstaymoon avatar May 01 '19 05:05 cloudstaymoon

you should rename the directory "relaynet_pytorch" to "networks" !

hwei-hw avatar May 01 '19 08:05 hwei-hw

you should rename the directory "relaynet_pytorch" to "networks" !

I did this, it didn't work.

qwertyuiop194 avatar May 12 '20 01:05 qwertyuiop194

you should rename the directory "relaynet_pytorch" to "networks" !

I did this, it didn't work.

sorry, have you solved the problem yet? I encoutered this problem too. I look forward to your reply sincerely.

yuanleilei12138 avatar Dec 10 '22 15:12 yuanleilei12138