Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got internal error in __sub: no metatable error when I train the sample dataset #36

Closed
naobit opened this issue Dec 31, 2016 · 7 comments

Comments

@naobit
Copy link

naobit commented Dec 31, 2016

I followed Getting Started instruction and installed pix2pix.
Then, downloaded facades dataset by bash ./datasets/download_dataset.sh facades
and run DATA_ROOT=./datasets/facades name=facades_generation which_direction=BtoA th train.lua

but I got the following error.

~/torch-cl/install/bin/luajit: ./models.lua:69: internal error in __sub: no metatable
stack traceback:
	[C]: in function '__sub'
	./models.lua:69: in function 'defineG_unet'
	train.lua:110: in function 'defineG'
	train.lua:146: in main chunk
	[C]: in function 'dofile'
	...i/torch-cl/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
	[C]: at 0x010ec81ce0

How can I fix this?

  • run on Mac OSX
  • python2.7
@limadm
Copy link

limadm commented Jan 2, 2017

I'm investigating this issue and it seems to have its roots in a torch-cl file. I registered an issue there.

@Quasimondo
Copy link

I am getting the same error. Is there any temporary workaround?

@phillipi
Copy link
Owner

phillipi commented Jan 5, 2017

Thanks for the pointer @limadm. Maybe it would work to rewrite defineG_unet without the __sub syntactic sugar, instead using the __call__ operator? You can see examples of how to do this here. Another workaround would be to rewrite defineG_unet using nn rather than nngraph, but that will be a bit cumbersome.

@Quasimondo
Copy link

So the workaround I found is to reactivate regular torch by reinstalling it. I didn't realize that if you install cl-torch it becomes the default torch. I'm pretty sure there must be a simpler way to switch between the distros, at least this comment suggests it: hughperkins/distro-cl#1 - but this line:

source ~/torch/install/bin/torch-activate
luajit -l cunn -e 'nn.testcuda()'

gave me some errors (but I might have messed up my torch installation at some earlier point)

@phillipi
Copy link
Owner

phillipi commented Jan 6, 2017

Great!

@phillipi phillipi closed this as completed Jan 6, 2017
@limadm
Copy link

limadm commented Jan 6, 2017

You can use cl-torch if you don't use this metamethod, like I did in this fork.
(it is what you said @phillipi)

@hj0921
Copy link

hj0921 commented Mar 9, 2017

@naobit what method have you used to solve this problem? Thank you!

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

No branches or pull requests

5 participants