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

报错 #1

Open
caorongzhe opened this issue Jul 30, 2019 · 1 comment
Open

报错 #1

caorongzhe opened this issue Jul 30, 2019 · 1 comment

Comments

@caorongzhe
Copy link

caorongzhe commented Jul 30, 2019

最后那个参数设置100w,等了十多天后,生成文章的时候,然后执行的时候报错了
File "sample.py", line 40, in
tf.app.run()
File "C:\Users\CAO\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\CAO\AppData\Local\Programs\Python\Python36\lib\site-packages\absl\app.py", line 300, in run
_run_main(main, args)
File "C:\Users\CAO\AppData\Local\Programs\Python\Python36\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "sample.py", line 35, in main
arr = model.sample(FLAGS.max_length, start, converter.vocab_size)
File "C:\Users\CAO\Desktop\SunRnn-master\model.py", line 163, in sample
c = pick_top_n(preds, vocab_size)
File "C:\Users\CAO\Desktop\SunRnn-master\model.py", line 15, in pick_top_n
c = np.random.choice(vocab_size, 1, p=p)[0]
File "mtrand.pyx", line 1144, in mtrand.RandomState.choice
ValueError: probabilities contain NaN

@zpeng1989
Copy link
Owner

numpy版本的问题:

这样你试试
python -c "import numpy;print numpy.version.version"
sudo pip install -U numpy==1.11.0

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

2 participants