我有两台没有CUDA的计算机:一台在Microsoft Windows上运行,另一台在Linux上运行(Ubuntu 14.04 64位/ Linux 3.13.0-100通用)
我可以在Microsoft Windows上不使用CUDA的情况下使用TensorFlow,而不会出现任何问题:TensorFlow使用CPU。但是,如果在Linux计算机上以python运行 import tensorflow as tf,则由于未安装CUDA,因此TensorFlow无法导入:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 72, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 61, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: …Run Code Online (Sandbox Code Playgroud)