Skip to content

Commit

Permalink
Add "allow_pickle=True"
Browse files Browse the repository at this point in the history
This makes it compatible with the latest `numpy`, otherwise, there would be an `Object arrays cannot be loaded when allow_pickle=False` error.
  • Loading branch information
lucifer1004 authored and chenyuntc committed Dec 24, 2019
1 parent 1e7f6ec commit 018291c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter9-神经网络写诗(CharRNN)/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get_data(opt):
@return data: numpy数组,每一行是一首诗对应的字的下标
"""
if os.path.exists(opt.pickle_path):
data = np.load(opt.pickle_path)
data = np.load(opt.pickle_path, allow_pickle=True)
data, word2ix, ix2word = data['data'], data['word2ix'].item(), data['ix2word'].item()
return data, word2ix, ix2word

Expand Down

0 comments on commit 018291c

Please sign in to comment.