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

IOError: could not read bytes #47

Closed
dgutyanghs opened this issue Dec 21, 2016 · 5 comments
Closed

IOError: could not read bytes #47

dgutyanghs opened this issue Dec 21, 2016 · 5 comments
Labels

Comments

@dgutyanghs
Copy link

dgutyanghs commented Dec 21, 2016

According your introduction , I execute it in shell, here I met a problem:

alex@alex-ubuntu1604:~/myprivate/github/neural-style$ python neural_style.py --content ./examples/1-content.jpg --styles ./examples/1-style.jpg --output ./examples/hello.jpg
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties: 
name: GeForce GTX 1080
major: 6 minor: 1 memoryClockRate (GHz) 1.797
pciBusID 0000:01:00.0
Total memory: 7.92GiB
Free memory: 7.34GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0 
I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0:   Y 
I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0)
Traceback (most recent call last):
  File "neural_style.py", line 156, in <module>
    main()
  File "neural_style.py", line 130, in main
    checkpoint_iterations=options.checkpoint_iterations
  File "/home/alex/myprivate/github/neural-style/stylize.py", line 41, in stylize
    net, mean_pixel = vgg.net(network, image)
  File "/home/alex/myprivate/github/neural-style/vgg.py", line 24, in net
    data = scipy.io.loadmat(data_path)
  File "/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 136, in loadmat
    matfile_dict = MR.get_variables(variable_names)
  File "/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio5.py", line 292, in get_variables
    res = self.read_var_array(hdr, process)
  File "/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio5.py", line 252, in read_var_array
    return self._matrix_reader.array_from_header(header, process)
  File "scipy/io/matlab/mio5_utils.pyx", line 673, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:7119)
  File "scipy/io/matlab/mio5_utils.pyx", line 719, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:6517)
  File "scipy/io/matlab/mio5_utils.pyx", line 892, in scipy.io.matlab.mio5_utils.VarReader5.read_cells (scipy/io/matlab/mio5_utils.c:8922)
  File "scipy/io/matlab/mio5_utils.pyx", line 671, in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix (scipy/io/matlab/mio5_utils.c:6027)
  File "scipy/io/matlab/mio5_utils.pyx", line 721, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:6547)
  File "scipy/io/matlab/mio5_utils.pyx", line 967, in scipy.io.matlab.mio5_utils.VarReader5.read_struct (scipy/io/matlab/mio5_utils.c:9877)
  File "scipy/io/matlab/mio5_utils.pyx", line 671, in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix (scipy/io/matlab/mio5_utils.c:6027)
  File "scipy/io/matlab/mio5_utils.pyx", line 719, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:6517)
  File "scipy/io/matlab/mio5_utils.pyx", line 892, in scipy.io.matlab.mio5_utils.VarReader5.read_cells (scipy/io/matlab/mio5_utils.c:8922)
  File "scipy/io/matlab/mio5_utils.pyx", line 671, in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix (scipy/io/matlab/mio5_utils.c:6027)
  File "scipy/io/matlab/mio5_utils.pyx", line 703, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy/io/matlab/mio5_utils.c:6244)
  File "scipy/io/matlab/mio5_utils.pyx", line 776, in scipy.io.matlab.mio5_utils.VarReader5.read_real_complex (scipy/io/matlab/mio5_utils.c:7572)
  File "scipy/io/matlab/mio5_utils.pyx", line 448, in scipy.io.matlab.mio5_utils.VarReader5.read_numeric (scipy/io/matlab/mio5_utils.c:4323)
  File "scipy/io/matlab/mio5_utils.pyx", line 353, in scipy.io.matlab.mio5_utils.VarReader5.read_element (scipy/io/matlab/mio5_utils.c:3913)
  File "scipy/io/matlab/streams.pyx", line 327, in scipy.io.matlab.streams.FileStream.read_string (scipy/io/matlab/streams.c:4992)
IOError: could not read bytes
alex@alex-ubuntu1604:~/myprivate/github/neural-style$ 
@anishathalye
Copy link
Owner

Hmm, is something wrong with your SciPy installation?

@anishathalye
Copy link
Owner

Also, did you download the right VGG net (the one linked in the repo)?

@dgutyanghs
Copy link
Author

I did use the link to download vgg file in your repo。

Pre-trained VGG network (MD5 8ee3263992981a1d26e73b3ca028a123) - put it in the top level of this repository, or specify its location using the --network option.

But, I got a wrong MD5 value below:

alex@alex-ubuntu1604:~/myprivate/github/neural-style$ md5sum imagenet-vgg-verydeep-19.mat 
8029d2d6941afbe121eb4c0a3e185e1f  imagenet-vgg-verydeep-19.mat

@anishathalye
Copy link
Owner

That means the file is corrupted - you should redownload it.

@dgutyanghs
Copy link
Author

Yes, it works!

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

No branches or pull requests

2 participants