torch / torch7

http://torch.ch
Other
9k stars 2.38k forks source link

load ***.t7 model , i got some error #1058

Closed visonpon closed 7 years ago

visonpon commented 7 years ago
require 'nn'
require 'cunn'
require 'torch'
require 'cutorch'
require 'cudnn'

th> m =torch.load('***.t7')

then the error like this:

torch_install/torch/install****/Fiule.lua unknow torch class stack traceback: [C]: in function 'error'. anyone know why? thanks~

albanD commented 7 years ago

It is because your model uses 'nngraph' but you did not require it before loading.

visonpon commented 7 years ago

thanks, @albanD it works~

salihkaragoz commented 6 years ago

@albanD @visonpon so well what is the correct way load the model? Which parameter or settings I should change? Thanks in advance...

UPDATE

require 'nn'
require 'cunn'
require 'torch'
require 'cutorch'
require 'cudnn'
require 'nngraph'
m = torch.load('xxxxx.t7')

has worked for me! :smile: