網頁

2019年5月4日 星期六

ValueError: Object arrays cannot be loaded when allow_pickle=False

Using TensorFlow backend.
Traceback (most recent call last):
  File "test_keras.py", line 13, in <module>
    (X_train, y_train), (X_test, y_test) = imdb.load_data(num_words=top_words)
  File "/usr/local/lib/python3.6/site-packages/keras/datasets/imdb.py", line 59, in load_data
    x_train, labels_train = f['x_train'], f['y_train']
  File "/usr/local/lib/python3.6/site-packages/numpy/lib/npyio.py", line 262, in __getitem__
    pickle_kwargs=self.pickle_kwargs)
  File "/usr/local/lib/python3.6/site-packages/numpy/lib/format.py", line 692, in read_array
    raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False


numpy版本不符合當前代碼,更新Numpy版本1.16.3,導致加載數據過程中出錯,

$ pip install numpy==1.16.2

參考
https://www.twblogs.net/a/5cc61956bd9eee1ac2ed4944

沒有留言:

張貼留言