2017-09-21 37 views
2

我正在學習有關Tensorflow(願它與我聊天機器人集成)運行它,並想運行在這裏找到了例子:TENSORFLOW機器上沒有GPU,不能老是管理對CPU只

https://www.tensorflow.org/tutorials/recurrent

我下載了建議庫,安裝tensorflow(現在唯一的CPU版本,但也試過在--gpu),但卡住了這一點:

python ptb_word_lm.py --data_path=simple-examples/data/ --model=small --rnn_mode=basic 
2017-09-21 17:38:09.856638: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 
2017-09-21 17:38:09.856685: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 
Traceback (most recent call last): 
    File "ptb_word_lm.py", line 532, in <module> 
    tf.app.run() 
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run 
    _sys.exit(main(_sys.argv[:1] + flags_passthrough)) 
    File "ptb_word_lm.py", line 459, in main 
    % (len(gpus), FLAGS.num_gpus)) 
ValueError: Your machine has only 0 gpus which is less than the requested --num_gpus=1. 

我的系統有沒有CUDA GPU(當然,它有,但CUDA 1.3,不是> = 3 tensorflow要求),如何得到噸他示例代碼運行在cpu-only模式而不是僅僅退出?

回答

5

您可以嘗試將gpus的數量設置爲您擁有的數量,即零。

python ptb_word_lm.py --data_path=simple-examples/data/ --model=small --rnn_mode=basic --num_gpus=0 

我收集了這起錯誤消息:

ValueError: Your machine has only 0 gpus which is less than the requested --num_gpus=1. 

既然你只有0 GPU的需要作爲默認假設爲1當您使用GPU來明確設置命令行參數包。

+0

作品!!! Tnks兄弟! – Caterpillaraoz

+1

錯誤消息非常有幫助;) –