-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
bad argument #1 to 'insert' (table expected, got nil) #62
Comments
Can you post your /usr/local/bin/luajit: models/VGG_ILSVRC_19_layers_deploy.prototxt.cpu.lua file? |
Thanks for the quick answer! Sure here it is: require 'nn' |
Aha, looks like loadcaffe changed a bit here: I was using a dirty dirty hack to allow neural-style to work with loadcaffe on CPU; looks like they have improved their CPU support, hopefully making my hack unnecessary. I don't have time right now to fix this, but for a quick workaround you can try installing the version of loadcaffe right before the commit I posted above. |
I seem to be running into the same issue.
|
For my case, by removing https://github.com/jcjohnson/neural-style/blob/master/loadcaffe_wrapper.lua#L41 and https://github.com/jcjohnson/neural-style/blob/master/loadcaffe_wrapper.lua#L43, it worked. |
@akkikiki solution worked for me as well |
@akkikiki solution also worked for me (now I just need some more RAM =\ ) |
For those doing akkikiki's workaround and not that fluent with lua like me, make sure you don't delete line 42. Thanks akkikiki - it works. |
@akkikiki Thanks for looking into this! I implemented your fix in 8795bbf. Interestingly, the reason I originally added the loadcaffe_wrapper (instead of just calling loadcaffe) was to make it work in CPU mode; now we don't need that, since loadcaffe works just fine in CPU mode. However we still need loadcaffe_wrapper because it copies the names of the layers from prototxt over to lua, which we need to set the layers to use for content and style targets. |
@jcjohnson Cool! Thanks for the work! I am glad to hear that my comment helped many people. |
Hey,
first of all awesome work, I really want to try it out myself but the results in the README.md look amazing!
Unfortunately after installing protobuf, torch and loadcaffe, I always get the following error when trying th neural_style.lua -gpu -1 -print_iter -1:
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:537] Reading dangerously large protocol message. If the message turns out to be larger than 1073741824 bytes, parsing will be halted for security reasons. To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:78] The total number of bytes read was 574671192
Successfully loaded models/VGG_ILSVRC_19_layers.caffemodel
/usr/local/bin/luajit: models/VGG_ILSVRC_19_layers_deploy.prototxt.cpu.lua:2: bad argument #1 to 'insert' (table expected, got nil)
stack traceback:
[C]: in function 'insert'
models/VGG_ILSVRC_19_layers_deploy.prototxt.cpu.lua:2: in main chunk
[C]: in function 'dofile'
./loadcaffe_wrapper.lua:48: in function 'load'
neural_style.lua:65: in function 'main'
neural_style.lua:454: in main chunk
[C]: in function 'dofile'
/usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:133: in main chunk
[C]: at 0x00405610
Do you know what is going wrong? Here are my system specs:
OS: Manjaro 15.09 Bellatrix
Kernel: x86_64 Linux 4.1.10-1-MANJARO
CPU: Intel Core i5-4200U CPU @ 2.6GHz
GPU: GeForce GT 730M
Thanks for your awesome work!
The text was updated successfully, but these errors were encountered: