Error in finding nn.SpatialReSampling while loading the model

11 views
Skip to first unread message

Pavani Tripathi

unread,
Mar 11, 2019, 5:24:05 PM3/11/19
to torch7
Hi,

I am getting the following error while loading the model using a checkpoint.

Loading.. checkpoints/results_40_40_10_RNN.t7
/home/iab-j/torch/install/bin/luajit: /home/iab-j/torch/install/share/lua/5.1/torch/File.lua:343: unknown Torch class <nn.SpatialReSampling>
stack traceback:
[C]: in function 'error'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:343: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/nn/Module.lua:192: in function 'read'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:353: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:368: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
...
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/nn/Module.lua:192: in function 'read'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
/home/iab-j/torch/install/share/lua/5.1/torch/File.lua:409: in function 'load'
RNN_main_test.lua:133: in main chunk
[C]: in function 'dofile'
...ab-j/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50

Any ideas on how can this error be removed?


Shen Jialiang

unread,
Mar 12, 2019, 12:58:11 AM3/12/19
to torch7
update your torch version 

Pavani Tripathi via torch7 <torch7+APn2wQdyQ9htGk_l2aAgt66UQ...@googlegroups.com> 于2019年3月12日周二 上午8:24写道:
--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at https://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.

Pavani Tripathi

unread,
Mar 14, 2019, 2:11:16 AM3/14/19
to torch7
Hi,

I used the following steps to install torch:
  1. git clone https://github.com/torch/distro.git ~/torch --recursive 
  2. cd ~/torch; bash install-deps;
  3. ./install.sh 
  4. source ~/.bashrc
as mentioned on the official page : http://torch.ch/docs/getting-started.html#_

I have run ./update.sh once. However, the error still persists.

How can I check if the installed version is the latest version or not?

On Tuesday, March 12, 2019 at 10:28:11 AM UTC+5:30, Shen Jialiang wrote:
update your torch version 

Pavani Tripathi via torch7 <torch7+APn2wQdyQ9htGk_l2aAgt66UQXpQ3vv7fxlbApSPWyIcwAUrn3b...@googlegroups.com> 于2019年3月12日周二 上午8:24写道:

Shen Jialiang

unread,
Mar 14, 2019, 5:13:07 AM3/14/19
to torch7
You can search whether nn.SpatialReSampling exists in your install package. If not search google to find some other version torch have this file. https://github.com/clementfarabet/lua---nnx

Pavani Tripathi via torch7 <torch7+APn2wQdyQ9htGk_l2aAgt66UQ...@googlegroups.com> 于2019年3月14日周四 下午5:11写道:
Hi,

I used the following steps to install torch:
  1. git clone https://github.com/torch/distro.git ~/torch --recursive 
  2. cd ~/torch; bash install-deps;
  3. ./install.sh 
  4. source ~/.bashrc
as mentioned on the official page : http://torch.ch/docs/getting-started.html#_

I have run ./update.sh once. However, the error still persists.

How can I check if the installed version is the latest version or not?

On Tuesday, March 12, 2019 at 10:28:11 AM UTC+5:30, Shen Jialiang wrote:
update your torch version 

Pavani Tripathi via torch7 <torch7+APn2wQdyQ9htGk_l2aAgt66UQ...@googlegroups.com> 于2019年3月12日周二 上午8:24写道:

Shen Jialiang

unread,
Mar 14, 2019, 5:13:36 AM3/14/19
to torch7

Pavani Tripathi via torch7 <torch7+APn2wQdyQ9htGk_l2aAgt66UQ...@googlegroups.com> 于2019年3月14日周四 下午5:11写道:
Hi,

I used the following steps to install torch:
  1. git clone https://github.com/torch/distro.git ~/torch --recursive 
  2. cd ~/torch; bash install-deps;
  3. ./install.sh 
  4. source ~/.bashrc
as mentioned on the official page : http://torch.ch/docs/getting-started.html#_

I have run ./update.sh once. However, the error still persists.

How can I check if the installed version is the latest version or not?

On Tuesday, March 12, 2019 at 10:28:11 AM UTC+5:30, Shen Jialiang wrote:
update your torch version 

Pavani Tripathi via torch7 <torch7+APn2wQdyQ9htGk_l2aAgt66UQ...@googlegroups.com> 于2019年3月12日周二 上午8:24写道:

Pavani Tripathi

unread,
Mar 14, 2019, 5:37:13 AM3/14/19
to torch7
Hi,

SpatialReSampling.lua and SpatialReSampling.c files exist in the following paths:
  1. /home/iab-j/torch/extra/nnx
  2. /home/iab-j/torch/install/share/lua/5.1/nnx

However, when I run the following command in torch terminal I get an error:

require 'nn' (no error, prints out all the layers)

local output = nn.SpatialReSampling{oheight=3, owidth=3}:forward(torch.Tensor(1,2,2)) (gives the following error)

[string "local output = nn.SpatialReSampling{oheight=3..."]:1: attempt to call field 'SpatialReSampling' (a nil value)
stack traceback:
[string "local output = nn.SpatialReSampling{oheight=3..."]:1: in main chunk
[C]: in function 'xpcall'
/home/iab-j/torch/install/share/lua/5.1/trepl/init.lua:679: in function 'repl'
...ab-j/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:204: in main chunk
[C]: at 0x00405e90



On Thursday, March 14, 2019 at 2:43:36 PM UTC+5:30, Shen Jialiang wrote:
Hi,

I used the following steps to install torch:
  1. git clone https://github.com/torch/distro.git ~/torch --recursive 
  2. cd ~/torch; bash install-deps;
  3. ./install.sh 
  4. source ~/.bashrc
as mentioned on the official page : http://torch.ch/docs/getting-started.html#_

I have run ./update.sh once. However, the error still persists.

How can I check if the installed version is the latest version or not?

On Tuesday, March 12, 2019 at 10:28:11 AM UTC+5:30, Shen Jialiang wrote:
update your torch version 

Pavani Tripathi via torch7 <torch7+APn2wQdyQ9htGk_l2aAgt66UQXpQ3vv7fxlbApSPWyIcwAUrn3b...@googlegroups.com> 于2019年3月12日周二 上午8:24写道:
Reply all
Reply to author
Forward
0 new messages