cheng6076 / SNLI-attention

SNLI with word-word attention by LSTM encoder-decoder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trying to load a saved model but getting an unknown Torch class <nn.AddScalar>

jpilaul opened this issue · comments

Trying to load a model.t7 but I am getting a:

model = torch.load('model.t7')

I am getting the following error
...Installations/torch/install/share/lua/5.1/torch/File.lua:343: unknown Torch class <nn.AddScalar>

local AddScalar = torch.class('nn.AddScalar')

works fine

You need to add:

require 'util.MaskedLoss'
require 'util.misc'
require 'util.CAveTable'
require 'optim'
require 'util.AddScalar'
require 'util.LookupTableEmbedding_train'
require 'util.Maskh'

when loading models