IOError:无法读取字节

时间:2019-07-02 08:55:02

标签: python ioerror

我对此有误:

Traceback (most recent call last):

  File "offline_patchMatch_textureSwap.py", line 45, in <module> net_vgg19 = VGG19(model_path=vgg19_model_path)

  File "/workspace/share/user/SRNTT-master/SRNTT/vgg19.py", line 38, in __init__
    self.layers = self.vgg19(reuse=True)

  File "/workspace/share/user/SRNTT-master/SRNTT/vgg19.py", line 41, in vgg19
    params = loadmat(self.model_path)

  File "/root/anaconda2/lib/python2.7/site-packages/scipy/io/matlab/mio.py", line 208, in loadmat
    matfile_dict = MR.get_variables(variable_names)

  File "/root/anaconda2/lib/python2.7/site-packages/scipy/io/matlab/mio5.py", line 292, in get_variables
    res = self.read_var_array(hdr, process)

  File "/root/anaconda2/lib/python2.7/site-packages/scipy/io/matlab/mio5.py", line 252, in read_var_array
    return self._matrix_reader.array_from_header(header, process)

  File "mio5_utils.pyx", line 675, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header

  File "mio5_utils.pyx", line 721, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header

  File "mio5_utils.pyx", line 894, in scipy.io.matlab.mio5_utils.VarReader5.read_cells

  File "mio5_utils.pyx", line 673, in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix

  File "mio5_utils.pyx", line 723, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header

  File "mio5_utils.pyx", line 969, in scipy.io.matlab.mio5_utils.VarReader5.read_struct

  File "mio5_utils.pyx", line 673, in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix

  File "mio5_utils.pyx", line 721, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header
  File "mio5_utils.pyx", line 894, in scipy.io.matlab.mio5_utils.VarReader5.read_cells
  File "mio5_utils.pyx", line 673, in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix
  File "mio5_utils.pyx", line 705, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header
  File "mio5_utils.pyx", line 778, in scipy.io.matlab.mio5_utils.VarReader5.read_real_complex
  File "mio5_utils.pyx", line 450, in scipy.io.matlab.mio5_utils.VarReader5.read_numeric
  File "mio5_utils.pyx", line 355, in scipy.io.matlab.mio5_utils.VarReader5.read_element
  File "streams.pyx", line 195, in scipy.io.matlab.streams.ZlibInputStream.read_string
  File "streams.pyx", line 188, in scipy.io.matlab.streams.ZlibInputStream.read_into


IOError: could not read bytes

和vgg.py中的代码如下:

def __init__(self, input_image=None, model_path='models/VGG19/imagenet-vgg-verydeep-19.mat', final_layer='relu5_1')

offline_patchMatch_textureSwap.py中的

就像这样:

net_vgg19 = VGG19(model_path=vgg19_model_path)

什么可能导致此错误?我已经搜索过了,但是没有帮助。我真的需要一些帮助。

0 个答案:

没有答案