Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch5 p143 line 44 无法保存模型 #16

Open
arisliang opened this issue Mar 11, 2018 · 0 comments
Open

ch5 p143 line 44 无法保存模型 #16

arisliang opened this issue Mar 11, 2018 · 0 comments

Comments

@arisliang
Copy link

arisliang commented Mar 11, 2018

tl.files.save_npz(emb_net.all_params, name=model_file_name + '.npz') 给出错误. 尝试用官方的例子https://github.com/tensorlayer/tensorlayer/blob/master/example/tutorial_word2vec_basic.py, 貌似也有类似的错误。

Save model, data and dictionaries!!!!!!!!!!
Traceback (most recent call last):
File "/home/ly/src/tl-play/ch5_word2vec.py", line 165, in
tl.files.save_npz(emb_net.all_params, name=model_file_name + '.npz')
File "/home/ly/anaconda3/envs/learning/lib/python3.6/site-packages/tensorlayer/files.py", line 1176, in save_npz
np.savez(name, params=save_list_var)
File "/home/ly/anaconda3/envs/learning/lib/python3.6/site-packages/numpy/lib/npyio.py", line 595, in savez
_savez(file, args, kwds, False)
File "/home/ly/anaconda3/envs/learning/lib/python3.6/site-packages/numpy/lib/npyio.py", line 693, in _savez
val = np.asanyarray(val)
File "/home/ly/anaconda3/envs/learning/lib/python3.6/site-packages/numpy/core/numeric.py", line 544, in asanyarray
return array(a, dtype, copy=False, order=order, subok=True)
ValueError: could not broadcast input array from shape (50000,128) into shape (50000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant