The saved model can't work when using torch.load(), model:evaluate(), attempt to call method 'evalua

9 views
Skip to first unread message

Yun Shen

unread,
Sep 30, 2017, 5:00:27 AM9/30/17
to torch7

Hi, guys,I use torch first time, and meet a problem: I construct a model is used dilated-Resnet101, and save the model in the file of .dat, but when I test the model, using torch.load(path), mode:evaluate() got an error. It says that: attempt to call method 'evaluate' (a nil value). Anyone else can help me, Thanks!
The cmd is "th test.lua -gpu -model model.dat"

local params = cmd:parse(arg)

cutorch.setDevice(params.gpu + 1)
local model = torch.load('models/' .. params.model):float()
model = model:cuda()
model:evaluate()


Reply all
Reply to author
Forward
0 new messages