machrisaa / tensorflow-vgg

VGG19 and VGG16 on Tensorflow
2.21k stars 1.08k forks source link

set allow_pickle True #77

Open LeiWang1999 opened 3 years ago

LeiWang1999 commented 3 years ago

When i execute this project on my machine , numpy.load(vgg19.npy) throw a err;

Traceback (most recent call last):
  File "test_vgg19.py", line 21, in <module>
    vgg = vgg19.Vgg19()
  File "/Users/wanglei/AICS-Course/Code/tensorflow-vgg/vgg19.py", line 20, in __init__
    self.data_dict = np.load(vgg19_npy_path, encoding='latin1').item()
  File "/Users/wanglei/opt/anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 453, in load
    pickle_kwargs=pickle_kwargs)
  File "/Users/wanglei/opt/anaconda3/lib/python3.7/site-packages/numpy/lib/format.py", line 739, in read_array
    raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False

I notice that my numpy version is 1.18.3,and the default value of allow_pickle was setted to False after the numpy version 1.17 released,so i give a value true explicitly.

The effect of allow_pickle can be seen here: image