【해결됨】ValueError: Object arrays cannot be loaded when allowpickle=False

2076 단어 tensorflow
질문: ValueError: Object arrays cannot be loaded when allowpickle=False 해결 방법: 업데이트 코드는 다음과 같습니다.
import numpy as np
# save np.load
np_load_old = np.load

# modify the default parameters of np.load
np.load = lambda *a,**k: np_load_old(*a, allow_pickle=True, **k)

# call load_data with allow_pickle implicitly set to true
(train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000)

# restore np.load for future normal usage
np.load = np_load_old

텍스트 링크:https://stackoverflow.com/questions/55890813/how-to-fix-object-arrays-cannot-be-loaded-when-allow-pickle-false-for-imdb-loa

좋은 웹페이지 즐겨찾기