Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

"attempt to index upvalue 't2c' (a nil value)" #33

Open
stalagmite7 opened this issue Aug 31, 2017 · 0 comments
Open

"attempt to index upvalue 't2c' (a nil value)" #33

stalagmite7 opened this issue Aug 31, 2017 · 0 comments

Comments

@stalagmite7
Copy link

stalagmite7 commented Aug 31, 2017

I'm trying to convert a torch model, but it breaks with this error:

th torch2caffe/torch2caffe.lua --input "/root/crnn/model/crnn_demo/crnn_demo_model.t7"  64 1 32 100
	Opts: %s	{
	  input_dims = {
		64,
		1,
		32,
		100
	  },
	  format = "lua",
	  input = "/root/crnn/model/crnn_demo/crnn_demo_model.t7",
	  caffemodel = "",
	  preprocessing = "",
	  prototxt = "",
	  verify = "",
	  input_tensor = ""
	}	
	Parsed opts: %s	{
	  input_dims = {
		64,
		1,
		32,
		100
	  },
	  inputs = {
		{
		  name = "data",
		  input_dims = {
			64,
			1,
			32,
			100
		  }
		}
	  },
	  input = "/root/crnn/model/crnn_demo/crnn_demo_model.t7",
	  format = "lua",
	  preprocessing = "",
	  verify = "",
	  prototxt = "",
	  caffemodel = ""
	}	
	Running with model: 	
	{
	  parameters : 
		{
		  1 : CudaTensor - size: 64x1x3x3
		  2 : CudaTensor - size: 64
		  3 : CudaTensor - size: 128x64x3x3
		  4 : CudaTensor - size: 128
		  5 : CudaTensor - size: 256x128x3x3
		  6 : CudaTensor - size: 256
		  7 : CudaTensor - size: 256
		  8 : CudaTensor - size: 256
		  9 : CudaTensor - size: 256x256x3x3
		  10 : CudaTensor - size: 256
		  11 : CudaTensor - size: 512x256x3x3
		  12 : CudaTensor - size: 512
		  13 : CudaTensor - size: 512
		  14 : CudaTensor - size: 512
		  15 : CudaTensor - size: 512x512x3x3
		  16 : CudaTensor - size: 512
		  17 : CudaTensor - size: 512x512x2x2
		  18 : CudaTensor - size: 512
		  19 : CudaTensor - size: 512
		  20 : CudaTensor - size: 512
		  21 : CudaTensor - size: 1024x512
		  22 : CudaTensor - size: 1024
		  23 : CudaTensor - size: 1024x256
		  24 : CudaTensor - size: 1024
		  25 : CudaTensor - size: 1024x512
		  26 : CudaTensor - size: 1024
		  27 : CudaTensor - size: 1024x256
		  28 : CudaTensor - size: 1024
		  29 : CudaTensor - size: 256x256
		  30 : CudaTensor - size: 256
		  31 : CudaTensor - size: 256x256
		  32 : CudaTensor - size: 256
		  33 : CudaTensor - size: 1024x256
		  34 : CudaTensor - size: 1024
		  35 : CudaTensor - size: 1024x256
		  36 : CudaTensor - size: 1024
		  37 : CudaTensor - size: 1024x256
		  38 : CudaTensor - size: 1024
		  39 : CudaTensor - size: 1024x256
		  40 : CudaTensor - size: 1024
		  41 : CudaTensor - size: 37x256
		  42 : CudaTensor - size: 37
		  43 : CudaTensor - size: 37x256
		  44 : CudaTensor - size: 37
		}
	  bnVars : 
		{
		  1 : CudaTensor - size: 256
		  2 : CudaTensor - size: 256
		  3 : CudaTensor - size: 512
		  4 : CudaTensor - size: 512
		  5 : CudaTensor - size: 512
		  6 : CudaTensor - size: 512
		}
	}
	/root/torch/install/bin/luajit: ./torch2caffe/lib.lua:158: attempt to index upvalue 't2c' (a nil value)
	stack traceback:
		./torch2caffe/lib.lua:158: in function 'convert'
		./torch2caffe/lib.lua:168: in function 'main'
		torch2caffe/torch2caffe.lua:23: in main chunk
		[C]: in function 'dofile'
		/root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
		[C]: at 0x00406670

Seems like in torch2caffe/lib.lua, the lib_py.py that is added as a requirement in line 19 is a nil value in function M.convert(), which I don't understand, because if this is a scope issue, isn't declaring it as a local variable at the beginning of the function going to ensure that it is seen in the rest of the body?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant