《Density-aware Single Image De-raining using a Multi-stream Dense Network》
我的环境:win10,python3.6,pytorch1.2.0
1.
ImportError: bad magic number in 'myutils': b'\x03\xf3\r\n'
解决办法:
删除myutils文件夹中的.pyc文件
2.
ModuleNotFoundError: No module named 'torch.utils.serialization'
因为新版torch中删掉了load_lua
解决办法:
安装torchfile:pip install torchfile(虚拟环境中请使用conda install torchfile)
将utils.py第7行中的from torch.utils.serialization import load_lua改为import torchfile,
将utils.py第90行中的load_lua改为torchfile.load
3.
RuntimeError: DataLoader worker (pid(s) 10740) exited unexpectedly
解决办法:
test.py中57行:parser.add_argument('--workers', type=int, help='number of data loading workers', default=1)
将default=1
改为default=0
(Windows系统中num_workers>0时会出现bug,所以只能设置为0)
4.
File "D:\1AA\DID_MDN\models\derain_dense.py", line 484, in forward
label_d11.data.resize_((1, 8, sizePatchGAN, sizePatchGAN)).fill_(label_result)
RuntimeError: set_sizes_contiguous is not allowed on a Tensor created from .data or .detach().
If your intent is to change the metadata of a Tensor (such as sizes / strides / storage / storage_offset)
without autograd tracking the change, remove the .data / .detach() call and wrap the change in a `with torch.no_grad():` block.
For example, change:
x.data.set_(y)
to:
with torch.no_grad():
x.set_(y)
解决办法:
将derain_residual.py和derain_dense.py中的:label_d11.data.resize_
改为:label_d11.resize_
两个文件中大概有三处,代码具体位置我记不太清楚了,可以根据报错提示查找
Reference:
https://blog.csdn.net/kent_xyli/article/details/89187558