jcjohnson / neural-style

Torch implementation of neural style algorithm
MIT License
18.31k stars 2.7k forks source link

Errors running neural-style in CPU mode #117

Open IAMJackal opened 8 years ago

IAMJackal commented 8 years ago

Total linux newb here, going through neural-style install on WIN 10 machine running Ubuntu on VirtualBox.

Do the terminal command:

~/neural-style$ th neural_style.lua -gpu -1 -print_iter -1

And get these errors:

[libprotobuf WARNING google/protobuf/io/coded_stream.cc:505] 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 /torch/install/bin/luajit: /usr/local/share/lua/5.1/loadcaffe/loadcaffe.lua:20: attempt to index a nil value stack traceback: /usr/local/share/lua/5.1/loadcaffe/loadcaffe.lua:20: in function 'load' neural_style.lua:73: in function 'main' neural_style.lua:499: in main chunk [C]: in function 'dofile' ...ckal/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x004065d0

All help appreciated and thanks in advance!

Jackal

svillafe commented 8 years ago

Did you figure out what to do in this case? I am having the same error... I am running the program in a Ubuntu 14.04 machine.

Regards

IAMJackal commented 8 years ago

@sdvf Finally got past above error. It was lots of trial and error, including installing and reinstalling torch and related apps several times and running through this guide several times. Used this for torch install:

http://torch.ch/docs/getting-started.html

Made the mistake of putting "sudo" on some commands. If you use sudo installation may be in your home only instead of /usr/lib.

After each of the installs, used "chown -R username:username /path" command to take ownership of an created directories before making next install (replace with your user name and path to your directory).

Most of the problems had to due with missing packages for needed for base programs, torch, lua, luarocks, luajit, etc., such as make, cmake, png and jpg support, etc.

This is what I get now with th $neural_style.lua -gpu -1 -print_iter -1:

[libprotobuf WARNING google/protobuf/io/coded_stream.cc:505] 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 conv1_1: 64 3 3 3 conv1_2: 64 64 3 3 conv2_1: 128 64 3 3 conv2_2: 128 128 3 3 conv3_1: 256 128 3 3 conv3_2: 256 256 3 3 conv3_3: 256 256 3 3 conv3_4: 256 256 3 3 conv4_1: 512 256 3 3 conv4_2: 512 512 3 3 conv4_3: 512 512 3 3 conv4_4: 512 512 3 3 conv5_1: 512 512 3 3 conv5_2: 512 512 3 3 conv5_3: 512 512 3 3 conv5_4: 512 512 3 3 fc6: 1 1 25088 4096 fc7: 1 1 4096 4096 fc8: 1 1 4096 1000 Setting up style layer 2 : relu1_1 Setting up style layer 7 : relu2_1 Setting up style layer 12 : relu3_1 Setting up style layer 21 : relu4_1 Setting up content layer 23 : relu4_2 Setting up style layer 30 : relu5_1

Will try to run actual files and post results.

Keep at it!

Jackal

BTW, gave up on Virtual Box running in windows. :( Now running Ubuntu 14.04 elementary OS on separate hard disk.

jcjohnson commented 8 years ago

Try -print_iter 1 instead of -print_iter -1 to print every iteration.

IAMJackal commented 8 years ago

@jcjohnson Thanks! This has been a huge linux learning experience for me. Next will try to install Linux nvidia GPU support without black screen problems. Was able to get them to work in Windows but it seems easier there for newbs like me. All help appreciated! :)

IAMJackal commented 8 years ago

First run without gpu:

$ th neural_style.lua -style_image escher_sphere.jpg -content_image drunk_jackal.jpg -gpu -1 [libprotobuf WARNING google/protobuf/io/coded_stream.cc:505] 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 conv1_1: 64 3 3 3 conv1_2: 64 64 3 3 conv2_1: 128 64 3 3 conv2_2: 128 128 3 3 conv3_1: 256 128 3 3 conv3_2: 256 256 3 3 conv3_3: 256 256 3 3 conv3_4: 256 256 3 3 conv4_1: 512 256 3 3 conv4_2: 512 512 3 3 conv4_3: 512 512 3 3 conv4_4: 512 512 3 3 conv5_1: 512 512 3 3 conv5_2: 512 512 3 3 conv5_3: 512 512 3 3 conv5_4: 512 512 3 3 fc6: 1 1 25088 4096 fc7: 1 1 4096 4096 fc8: 1 1 4096 1000 Setting up style layer 2 : relu1_1 Setting up style layer 7 : relu2_1 Setting up style layer 12 : relu3_1 Setting up style layer 21 : relu4_1 Setting up content layer 23 : relu4_2

svillafe commented 8 years ago

@IAMJackal Thanks for the tip.

thistleknot commented 8 years ago

alternatively, you can run th neural_style.lua as sudo

eth100tx commented 7 years ago

Same problem.. fixed without reinstall, ran "sudo chown -R username:username /path" command to take ownership of an created directories before making next install (replace with your user name and path to your directory).

hitminxuanwang commented 7 years ago

thx @eth100tx my problem was solved by using the command!

mhulse commented 6 years ago

After each of the installs, used "chown -R username:username /path"

I don't see /path on my vagrant box? Is this meant to be taken literally?

What directory is /path?

mhulse commented 6 years ago

My problem ended being that I ran the model download script and the models/etc. ended up in my home directory; I moved them into ~/neural-style/models. I updated my provisioning script to run the shell script for models within the models directory so there's no confusion next time.