2017-03-16 69 views
0

程序可以從downloaded「導入錯誤:沒有模塊名爲core_rnn」當我使用tensorflow和使用tflearn

錯誤:

Traceback (most recent call last): File "/home/imatrix/download/ chrisruk/cnn-master/train_cnn.py", line 7, in import tflearn

File "/usr/local/lib/python2.7/dist-packages/tflearn/init.py", line 21, in from .layers import normalization File "/usr/local/lib/python2.7/dist-packages/tflearn/layers/init.py", line 10, in from .recurrent import lstm, gru, simple_rnn, bidirectional_rnn, \ File "/usr/local/lib/python2.7/dist-packages/tflearn/layers/recurrent.py", line 8, in ImportError: No module named core_rnn

回答

0

最有可能的錯誤是因爲不兼容的版本tflearntensorflow。 (可能你已經更新了tflearn,但沒有更新tensorflow)。

嘗試刪除tensorflowtflearn包並安裝最新版本:

pip uninstall tflearn 
pip uninstall tensorflow 
pip install -I tensorflow 
pip install -I tflearn 

或者,如果你不想使用tensorflow v1.0然後安裝舊版本的兩個包:

pip uninstall tflearn 
pip uninstall tensorflow 
pip install -I tensorflow==0.12.1 
pip install -I tflearn==0.2.1 
+1

謝謝〜我這個問題已經通過這種方式解決了! – iMatrix

0

假設Tf 0.12起這些已移至:

tf.contrib.rnn [followed by whichever core_rnn. you need ] 
相關問題