Hi,
I want to load Lua model like this,
model = Net()
model.cuda()
from torch.utils.serialization import load_lua
model.load_state_dict(load_lua(’/home/nn4.small2.v1.t7’))
But I got unknown class and can not load model, is there anyway to fix it?
/home/lab/yifan/venv/local/lib/python2.7/site-packages/torch/utils/serialization/read_lua_file.pyc in read_object(self)
538 "{}. If you want to ignore this error and load this object "
539 "as a dict, specify unknown_classes=True in reader’s "
–> 540 “constructor”).format(cls_name))
541
542 def _can_be_list(self, table):
T7ReaderException: don’t know how to deserialize Lua class nn.SpatialConvolutionMM. If you want to ignore this error and load this object as a dict, specify unknown_classes=True in reader’s constructor
Thanks a lot!