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

load vgg weight error #15

Open
i4yyds opened this issue Dec 8, 2018 · 3 comments
Open

load vgg weight error #15

i4yyds opened this issue Dec 8, 2018 · 3 comments

Comments

@i4yyds
Copy link

i4yyds commented Dec 8, 2018

RuntimeError: Error(s) in loading state_dict for ModuleList:
Missing key(s) in state_dict: "0.weight", "0.bias", "2.weight", "2.bias", "5.weight", "5.bias", "7.weight", "7.bias", "10.weight", "10.bias", "12.weight", "12.bias", "14.weight", "14.bias", "17.weight", "17.bias", "19.weight", "19.bias", "21.weight", "21.bias", "24.weight", "24.bias", "26.weight", "26.bias", "28.weight", "28.bias".
Unexpected key(s) in state_dict: "features.0.weight", "features.0.bias", "features.2.weight", "features.2.bias", "features.5.weight", "features.5.bias", "features.7.weight", "features.7.bias", "features.10.weight", "features.10.bias", "features.12.weight", "features.12.bias", "features.14.weight", "features.14.bias", "features.17.weight", "features.17.bias", "features.19.weight", "features.19.bias", "features.21.weight", "features.21.bias", "features.24.weight", "features.24.bias", "features.26.weight", "features.26.bias", "features.28.weight", "features.28.bias", "classifier.0.weight", "classifier.0.bias", "classifier.3.weight", "classifier.3.bias", "classifier.6.weight", "classifier.6.bias".

could you help me ?thanks

@AceCoooool
Copy link
Owner

Which the pytorch version and torchvision version you use?
maybe you can use 链接: https://pan.baidu.com/s/1XbNjFJm5KmLJTFvU7uL4IQ 提取码: h3er this link to download vgg_weights

@i4yyds
Copy link
Author

i4yyds commented Dec 9, 2018

torch=0.4.1
torchvision=0.2.1
After using the pre-training VGG model you provided, the error was reported as follows:

Traceback (most recent call last):
File "F:/DSS-pytorch-master2/main.py", line 95, in
main(config)
File "F:/DSS-pytorch-master2/main.py", line 25, in main
train.train()
File "F:\DSS-pytorch-master2\solver.py", line 131, in train
for i, data_batch in enumerate(self.train_loader):
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\utils\data\dataloader.py", line 501, in iter
return _DataLoaderIter(self)
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\utils\data\dataloader.py", line 289, in init
w.start()
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\Lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\Lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\Lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\Lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\Lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'get_loader..'
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\Lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\Lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

@AceCoooool
Copy link
Owner

我这边Ubuntu下面没有这个问题。你看看是否是因为一些路径的问题呢?比如Line 32里面的路径在windows下应该为\而不是/

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

2 participants