pytorch-vdsr icon indicating copy to clipboard operation
pytorch-vdsr copied to clipboard

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

Open Deephome opened this issue 7 years ago • 3 comments

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 )

Deephome avatar Feb 08 '18 03:02 Deephome

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 avatar Feb 12 '18 15:02 twtygqyy

CPU mode is now supported for eval.py

twtygqyy avatar Feb 12 '18 17:02 twtygqyy

@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?

CHUANGQIJI avatar Nov 17 '18 13:11 CHUANGQIJI