anishathalye / neural-style

Neural style in TensorFlow! 🎨
https://anishathalye.com/an-ai-that-can-mimic-any-artist/
GNU General Public License v3.0
5.54k stars 1.51k forks source link

i run the demo on the amzon #8

Closed szad670401 closed 8 years ago

szad670401 commented 8 years ago

i apply the one year free amazon ec2 service .(1G RAM 2.5G CPU 10GB ROM) after I run the neural_style.py about 30s It appear a error.

Is that i don't have enough memory?

I tensorflow/core/common_runtime/local_device.cc:25] Local device intra op parallelism threads: 1 I tensorflow/core/common_runtime/local_session.cc:45] Local session inter op parallelism threads: 1 Traceback (most recent call last): File "neural_style.py", line 122, in main() File "neural_style.py", line 108, in main checkpoint_iterations=options.checkpoint_iterations) File "/home/ubuntu/neural-styletf/neural-style/stylize.py", line 51, in stylize net, = vgg.net(network, image) File "/home/ubuntu/neural-style_tf/neural-style/vgg.py", line 22, in net data = scipy.io.loadmat(data_path) File "/usr/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 126, in loadmat matfile_dict = MR.get_variables(variable_names) File "/usr/lib/python2.7/dist-packages/scipy/io/matlab/mio5.py", line 288, in get_variables res = self.read_var_array(hdr, process) File "/usr/lib/python2.7/dist-packages/scipy/io/matlab/mio5.py", line 248, in read_var_array return self._matrix_reader.array_from_header(header, process) File "mio5_utils.pyx", line 616, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:6021) File "mio5_utils.pyx", line 661, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:5642) File "mio5_utils.pyx", line 829, in scipy.io.matlab.mio5_utils.VarReader5.read_cells (scipy/io/matlab/mio5_utils.c:7689) File "mio5_utils.pyx", line 614, in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix (scipy/io/matlab/mio5_utils.c:5252) File "mio5_utils.pyx", line 663, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:5664) File "mio5_utils.pyx", line 907, in scipy.io.matlab.mio5_utils.VarReader5.read_struct (scipy/io/matlab/mio5_utils.c:8581) File "mio5_utils.pyx", line 614, in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix (scipy/io/matlab/mio5_utils.c:5252) File "mio5_utils.pyx", line 661, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:5642) File "mio5_utils.pyx", line 829, in scipy.io.matlab.mio5_utils.VarReader5.read_cells (scipy/io/matlab/mio5_utils.c:7689) File "mio5_utils.pyx", line 614, in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix (scipy/io/matlab/mio5_utils.c:5252) File "mio5_utils.pyx", line 645, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:5448) File "mio5_utils.pyx", line 713, in scipy.io.matlab.mio5_utils.VarReader5.read_real_complex (scipy/io/matlab/mio5_utils.c:6445) File "mio5_utils.pyx", line 417, in scipy.io.matlab.mio5_utils.VarReader5.read_numeric (scipy/io/matlab/mio5_utils.c:3949) File "mio5_utils.pyx", line 353, in scipy.io.matlab.mio5_utils.VarReader5.read_element (scipy/io/matlab/mio5_utils.c:3657) File "streams.pyx", line 321, in scipy.io.matlab.streams.FileStream.read_string (scipy/io/matlab/streams.c:4418) File "pyalloc.pxd", line 9, in scipy.io.matlab.pyalloc.pyalloc_v (scipy/io/matlab/streams.c:5083) MemoryError

anishathalye commented 8 years ago

The amount of RAM is related to the size of the images you want to process and render. Also, I recommend a GPU instance, and it'll make everything a whole lot faster.

I'm running stuff on a computer with 32GB RAM and a Titan X (with 12GB of GDDR5), and I can process megapixel-size image on there.

On my laptop with 12GB of RAM, using the CPU only, I can still process megapixel-size images, but it's pretty darn slow unless the output image size is small.

szad670401 commented 8 years ago

I download a 200*200 image and i try it again it appeared.

ubuntu@ip-172-31-36-142:~/neural-style_tf/neural-style$ python neural_style.py --content ./d043ad4bd11373f0d762cd3aa60f4bfbfbed0431.jpg --styles ./examples/2-style1.jpg --output demo.jpg I tensorflow/core/common_runtime/local_device.cc:25] Local device intra op parallelism threads: 1 I tensorflow/core/common_runtime/local_session.cc:45] Local session inter op parallelism threads: 1 Segmentation fault

anishathalye commented 8 years ago

Huh, no idea what's going on. I've never tried using TensorFlow on a machine with such a small amount of memory.

szad670401 commented 8 years ago

I will try on mac laptop tomorrow