Как удалить tensorflow ubuntu

Обновлено: 04.07.2024

My tensorflow-gpu runs only on cpu, how to fix it?
I've already tried to set
CUDA_DEVICE_VISIBLE=all my gpus But it didn't work.

The text was updated successfully, but these errors were encountered:

I've noticed that using pip install tensorflow-gpu also installs tensorflow as a dependency, but pip install tensorflow-gpu==1.2.1 does not demonstrate this behavior. Is this an issue with the 1.3 rollout, or am I completely missing something?

ArturoDeza commented Aug 18, 2017

Something also to check: install Tensorflow from source (with Bazel). That's what I did, and it started running processes on GPU.

I don't think it is the problem. Because tensorflow worked properly all the time before I uninstalled it for some reason.(The reason is somehow only SGD optimizer doesn't work in keras while other optimizers work well.) However, when I try to reinstall tensorflow, this problem shows up.
The output of $nvcc -V :
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61

The output of nvidia-smi :
`| NVIDIA-SMI 375.66 Driver Version: 375.66 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1080 Off | 0000:04:00.0 Off | N/A |
| 0% 24C P8 11W / 180W | 113MiB / 8114MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce GTX 1080 Off | 0000:05:00.0 Off | N/A |
| 0% 25C P8 6W / 180W | 2MiB / 8114MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 2 GeForce GTX 1080 Off | 0000:08:00.0 Off | N/A |
| 0% 26C P8 6W / 180W | 2MiB / 8114MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 3 GeForce GTX 1080 Off | 0000:09:00.0 Off | N/A |
| 0% 26C P8 6W / 180W | 2MiB / 8114MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 4 GeForce GTX 1080 Off | 0000:85:00.0 Off | N/A |
| 0% 24C P8 6W / 180W | 2MiB / 8114MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 5 GeForce GTX 1080 Off | 0000:86:00.0 Off | N/A |
| 0% 28C P8 6W / 180W | 2MiB / 8114MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 6 GeForce GTX 1080 Off | 0000:89:00.0 Off | N/A |
| 0% 26C P8 6W / 180W | 2MiB / 8114MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 7 GeForce GTX 1080 Off | 0000:8A:00.0 Off | N/A |
| 0% 27C P8 6W / 180W | 2MiB / 8114MiB | 0% Default |
+-------------------------------+----------------------+----------------------+

@mykalu
Oh my god! It works! Tensorflow runs on gpus.
Thank you very much.
Maybe the latest version of tensorflow(1.3.1) isn't compatible with my CUDA

I have encountered the same problem (ubuntu16.04).
As mykalu-san said, my 'pip install tensorflow-gpu' also installed tensorflow.

vell001 commented Aug 20, 2017

same problem to me, I am using tensorflow(1.3.0)

DNXie commented Aug 21, 2017

@vell001
try to use this
pip install tensorflow-gpu==1.2.1

skyoung commented Aug 22, 2017

Just as @mykalu said, it's really confusing that pip3 install tensorflow-gpu also install tensorflow . And it seems that this makes gpu version not work.

ali01 commented Aug 28, 2017

This question is better asked on StackOverflow since it is not a bug or feature request. There is also a larger community that reads questions there. Thanks!

srowen commented Aug 28, 2017

@DNXie @skyoung @mykalu I had the same problem, but then found that I had tensorflow-tensorboard 0.1.4 installed which depends on tensorflow . That seemed to be the source of the erroneous dependency, and updating it to 0.1.5 made it all work for me because tensorflow wasn't installed anymore.

convoliution commented Aug 28, 2017

@srowen Nice catch, that worked for me. Thanks!

DNXie commented Aug 29, 2017

@srowen
That's true. I have tensorboard on that version too. Thank you!

SimonWalsh1000 commented Oct 20, 2017

@mykalu when I run pip install tensorflow-gpu==1.3.0 I also have a folder called tensorflow. Is this correct? I am having the same issue - my GPU is not being utilized.

AmanuelHirpa commented Jan 19, 2018

uninstalling tensorflow-gpu==1.3.0 and installing tensorflow-gpu==1.2.1 worked for me! thanks

As of writing the latest versions of TF only support the Titan V on the consumer side 😑

For cuDNN download usually to /usr/local and extract.

Finally, reinstall. TF version depends on GPU and Cuda version.

jiforcen commented Jan 23, 2018

For me tf 1.4.1 works properly.

caiosuzuki commented Jan 23, 2018

@jiforcen Could you tell me which method you used to install the CUDA toolkit, CuDNN and TensorFlow(GPU)? I've been trying several methods for days now and I just can't make tensorflow detect my GPU.

jiforcen commented Jan 23, 2018

shayan09 commented Jan 25, 2018

My code was running on the CPU, so I changed tensorflow-gpu from version 1.4.1 to 1.2.1 and now it shows me the following error. Please help me out here.

Using TensorFlow backend.
Traceback (most recent call last):
File "extract_features.py", line 16, in
from data import DataSet
File "/home/shayan/five-video-classification-methods/data.py", line 12, in
from processor import process_image
File "/home/shayan/five-video-classification-methods/processor.py", line 4, in
from keras.preprocessing.image import img_to_array, load_img
File "/usr/local/lib/python2.7/dist-packages/keras/init.py", line 3, in
from . import activations
File "/usr/local/lib/python2.7/dist-packages/keras/activations.py", line 3, in
from . import backend as K
File "/usr/local/lib/python2.7/dist-packages/keras/backend/init.py", line 64, in
from .tensorflow_backend import *
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 1, in
import tensorflow as tf
File "/usr/local/lib/python2.7/dist-packages/tensorflow/init.py", line 24, in
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/init.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

JennyyiqiWang commented Jan 27, 2018

@shayan09 Have you fixed the problem? I have got into the same trouble.

shayan09 commented Jan 27, 2018

The current version of CUDA is not supported by tensorflow. So just downgrade your CUDA version to 7.0 and then reinstall the normal tensorflow and then tensorflow-gpu. Worked for me.

ironfroggy commented Feb 2, 2018

Having the same trouble and none of the advice works. Can't downgrade CUDA, tensorflow-gpu package looks for 9.0 DLLs explicitly. I can watch my CPU/GPU usage while its running and TF says its running through the GPU, but the CPU is pegged at 100% and the GPU usage hovers around 5%. I tried adjusting the batch size as high as I can get it without hitting OOM errors, but it seemed to make no difference. (elsewhere I read small batch sizes might make the GPU throughput suffer).

Are there known current issues with the windows binaries for the Tensorflow1.5.0/CUDA 9.0/cuDNN 7.0 combination? If there are known issues, is there a previous combination that might work? If there are other steps that might be overlooked to run on the GPU, are there guides for common missteps?

Having similar problems as @ironfroggy with Win10/Tensorflow1.5.0/CUDA 9.0/cuDNN 7.0 combination

MyVanitar commented Feb 11, 2018

I have the same problem with Tensorflow 1.5 and Cuda 9.0 :-(

I have the same problem as yours. Could you find a solution?

Likewise, same problem. tensorflow-gpu==1.5.0/Cuda9.0/cuDNN7.0/windows 7.
I'll add that when I first encountered the problem I was getting an error importing tensorflow stating that it couldn't find cudart64_90.dll (it was in my path). After I restarted my computer, tensorflow successfully imported, but it just uses cpu.

UPDATE: It seemed to be a driver issue for me: I uninstalled, re-downloaded, and re-installed my gpu drivers, restarted my computer, and it seems to be working fine now!

Читайте также: