1、查看版本
Arithmetic@qingjiaowosuanshujiadeMacBook-Pro leetcode % python3
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 26 2018, 19:50:54)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
return f(*args, **kwds)
>>> tf.__version__
'1.14.0'
>>>
python(3) # 如果有两个版本的话
>>>import tensorflow as tf
>>>tf.__version__
2、查看是否使用cpu
import tensorflow as tf
# sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
tf.test.is_gpu_available(
cuda_only=False,
min_cuda_compute_capability=None
)
被注释的也可以,就是看日志