I have installed both tensorflow 2.2.0
and tensorflow 1.15.0
(by pip install tensorflow-gpu==1.15.0
). The tensorflow 2 is installed in the base environment of Anaconda 3
, while the tensorflow 1 is installed in a separate environment.
The tensorflow 2.2.0 can recognize gpu based on a simple test:
if tf.test.gpu_device_name():
print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
//output: Default GPU Device: /device:GPU:0
But the tensorflow 1.15.0 can not detect gpu.
For your information, my system environment is python + cuda 10.1 + vs 2015.