简体   繁体   中英

GPU not detected by Tensorflow V1

I'm currently using Tf 1.1.0. I tried to list out the available devices by using the following command

print(device_lib.list_local_devices())

It displayed only CPU but not GPU. When I ran the same command with tf 2.xx, both CPU and GPU were displayed. Is there a way to make tf v1 detect my GPU,Coz I'm not willing to switch to tf v2

My model is being trained on CPU as tf isn't detecting the GPU

If you are not willing to switch to TensorFlow 2.x, you can try updating your GPU drivers, and specifying which GPU to use when running TensorFlow. You can do this using the CUDA_VISIBLE_DEVICES environment variable. For example:

CUDA_VISIBLE_DEVICES=0 python your_script.py

This will tell TensorFlow to use the first GPU (with an index of 0) when running your script. You can change the index to specify a different GPU.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM