scnn_pytorch
scnn_pytorch copied to clipboard
can not convert from .t7
Thank you for sharing your code. But when i run the t7_to_pth.py with PyTorch 0.4.1, some error happens,the error is as follows:
File "t7_to_pth.py", line 93, in
please help me!
The pretrained model provided by the author has been updated and it might be a little bit different from the original version. A feasible way is to insert .modules[0] before .weight in lines between 93 and 96.
model2[prefix+'conv_d.weight'] = model1.modules[42].modules[6].modules[0].modules[0].modules[2].modules[0].modules[1].modules[1].modules[0].weight
model2[prefix+'conv_u.weight'] = model1.modules[42].modules[6].modules[0].modules[0].modules[140].modules[1].modules[2].modules[0].modules[0].weight
model2[prefix+'conv_r.weight'] = model1.modules[42].modules[6].modules[1].modules[0].modules[2].modules[0].modules[1].modules[1].modules[0].weight
model2[prefix+'conv_l.weight'] = model1.modules[42].modules[6].modules[1].modules[0].modules[396].modules[1].modules[2].modules[0].modules[0].weight
The pretrained model provided by the author has been updated and it might be a little bit different from the original version. A feasible way is to insert
.modules[0]before.weightin lines between 93 and 96.model2[prefix+'conv_d.weight'] = model1.modules[42].modules[6].modules[0].modules[0].modules[2].modules[0].modules[1].modules[1].modules[0].weight model2[prefix+'conv_u.weight'] = model1.modules[42].modules[6].modules[0].modules[0].modules[140].modules[1].modules[2].modules[0].modules[0].weight model2[prefix+'conv_r.weight'] = model1.modules[42].modules[6].modules[1].modules[0].modules[2].modules[0].modules[1].modules[1].modules[0].weight model2[prefix+'conv_l.weight'] = model1.modules[42].modules[6].modules[1].modules[0].modules[396].modules[1].modules[2].modules[0].modules[0].weight
It works ! Thanks.
Thank you for sharing your code. But when i run the t7_to_pth.py with PyTorch 0.4.1, some error happens,the error is as follows: torch.utils.serialization.read_lua_file.T7ReaderException: unknown type id 968499410. The file may be corrupted. And Baidu teaches me to use model trained by pytorch. How can I do? Please help me. Thank you very much.
https://github.com/bobbens/sketch_simplification/issues/2#issuecomment-361601015