1.python版本为Python 3.7.6
3.为防止参考失效,这里补充一下
版本
tensorflow1.15
pip install keras==2.3.1
安装之前升级 pip和numpy和virtualenv
检查tensorflow安装是否成功
>>> import numpy
>>> numpy.__version__
'1.19.1'
>>> import tensorflow as tf
2020-10-29 21:03:29.426564: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
2020-10-29 21:03:29.438847: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
>>> print(tf.__version__)
1.15.0
>>> hello=tf.constant('Hello,TensorFlow!')
>>> sess=tf.Session()
2020-10-29 21:04:27.150051: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2020-10-29 21:04:27.153995: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
2020-10-29 21:04:27.257908: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: USER-PC
2020-10-29 21:04:27.262164: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: USER-PC
2020-10-29 21:04:27.277681: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
>>> print(sess.run(hello))
b'Hello,TensorFlow!'
>>>
检查keras是否安装成功
>>> import keras
Using TensorFlow backend.
>>> keras.__version__
'2.3.1'
>>>