Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TENSORFLOW on machine with no GPU, can`t manage to run it on CPU only

Tags:

tensorflow

I am learning about Tensorflow (would like to integrate it with my chatbot) and would like to run the example found here:

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

I downloaded the suggested repository, installed tensorflow (now the cpu-only version, but tried also the --gpu) but got stuck with this:

 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.

My system has no CUDA GPU (well, it has, but CUDA 1.3, not the >=3 that tensorflow requires), how to get the example code to run in cpu-only mode instead of just quitting?

like image 606
Caterpillaraoz Avatar asked Dec 24 '22 14:12

Caterpillaraoz


1 Answers

You could try to set the num of gpus to the number you have, which is zero.

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

I gathered this from the error message:

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

Since you only have 0 gpus you need to set that command line arg explicitly as the default is assumed to be 1 when you use the gpu packages.

like image 160
Billy Ferguson Avatar answered Jun 05 '23 17:06

Billy Ferguson