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

Can't run eval.py using provided model & Training using default settings get bad results #16

Open
Deephome opened this issue Feb 8, 2018 · 3 comments

Comments

@Deephome
Copy link

Deephome commented Feb 8, 2018

T have some problems, can you give me some advice, thanks!
1)run eval.py ,get errors as follows:
/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'torch.nn.parallel.data_parallel.DataParallel' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'vdsr.Net' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'torch.nn.modules.activation.ReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
Processing Set5_mat/bird_GT_x2.mat
Traceback (most recent call last):
File "/home/yang/Code/DeblurSR/SR/pytorch-vdsr-master/eval.py", line 64, in
HR = model(im_input)
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(*input, **kwargs)
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py", line 64, in forward
inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids)
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py", line 75, in scatter
return scatter_kwargs(inputs, kwargs, device_ids, dim=self.dim)
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/parallel/scatter_gather.py", line 30, in scatter_kwargs
inputs = scatter(inputs, target_gpus, dim) if inputs else []
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/parallel/scatter_gather.py", line 25, in scatter
return scatter_map(inputs)
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/parallel/scatter_gather.py", line 18, in scatter_map
return list(zip(*map(scatter_map, obj)))
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/parallel/scatter_gather.py", line 15, in scatter_map
return Scatter.apply(target_gpus, None, dim, obj)
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/parallel/_functions.py", line 67, in forward
streams = [_get_stream(device) for device in ctx.target_gpus]
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/parallel/_functions.py", line 67, in
streams = [_get_stream(device) for device in ctx.target_gpus]
File "/home/yang/Software/anaconda3/lib/python3.5/site-packages/torch/nn/parallel/_functions.py", line 94, in _get_stream
if _streams[device] is None:
IndexError: list index out of range
2) train the model using default setting , then eval the trained model,but vdsr 's results are bad ( close to bicubic performance )

@twtygqyy
Copy link
Owner

hi @Deephome, did you run python eval.py --cuda ? if run without cuda opinion, please change model = torch.load(opt.model)["model"] to model = torch.load(opt.model)["model"].module and give a try

@twtygqyy
Copy link
Owner

CPU mode is now supported for eval.py

@CHUANGQIJI
Copy link

@Deephome. hi. For train the model using default setting , then eval the trained model,but vdsr 's results are bad ( close to bicubic performance ).Now,I get the vdsr's results are bad too( close to bicubic performance ).how did you deal?

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

3 participants