卸载 TensorFlow
1. TensorFlow 信息
strong@foreverstrong:~$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'1.3.0'
>>>
>>> tf.__path__
['/usr/local/lib/python2.7/dist-packages/tensorflow']
>>>
>>> exit()
strong@foreverstrong:~$
strong@foreverstrong:~$ pip list | grep tensorflow
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
tensorflow-gpu 1.3.0
tensorflow-tensorboard 0.1.8
You are using pip version 18.0, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
strong@foreverstrong:~$ pip list | grep tensorflow
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
tensorflow 1.4.0
tensorflow-tensorboard 0.4.0
You are using pip version 18.0, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
1.1. pip list | grep tensorflow
strong@foreverstrong:~$ pip list | grep tensorflow
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
tensorflow-gpu 1.4.0
tensorflow-tensorboard 0.4.0
You are using pip version 18.0, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
1.2. pip3 list | grep tensorflow
strong@foreverstrong:~$ pip3 list | grep tensorflow
tensorflow (1.7.0)
tensorflow-tensorboard (0.4.0rc3)
You are using pip version 8.1.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
2. 卸载 TensorFlow - pip
sudo pip uninstall tensorflow-gpu
sudo pip uninstall tensorflow-gpu==1.3.0
sudo pip uninstall tensorflow
sudo pip uninstall tensorflow==1.4.0
strong@foreverstrong:~$ sudo pip uninstall tensorflow-gpu
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling tensorflow-gpu-1.3.0:
Would remove:
/usr/local/bin/saved_model_cli
/usr/local/bin/tensorboard
/usr/local/lib/python2.7/dist-packages/external/*
/usr/local/lib/python2.7/dist-packages/tensorflow/*
/usr/local/lib/python2.7/dist-packages/tensorflow_gpu-1.3.0.dist-info/*
Proceed (y/n)? y
Successfully uninstalled tensorflow-gpu-1.3.0
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 18.0, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
strong@foreverstrong:~$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow
>>>
>>> exit()
strong@foreverstrong:~$
strong@foreverstrong:~$ sudo pip uninstall tensorflow
[sudo] password for strong:
Sorry, try again.
[sudo] password for strong:
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling tensorflow-1.4.0:
Would remove:
/usr/local/bin/saved_model_cli
/usr/local/bin/tensorboard
/usr/local/lib/python2.7/dist-packages/external/*
/usr/local/lib/python2.7/dist-packages/tensorflow-1.4.0.dist-info/*
/usr/local/lib/python2.7/dist-packages/tensorflow/*
Proceed (y/n)? y
Successfully uninstalled tensorflow-1.4.0
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 18.0, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
3. 卸载 TensorFlow - pip3
sudo pip3 uninstall tensorflow-gpu
sudo pip3 uninstall tensorflow-gpu==1.3.0
sudo pip3 uninstall tensorflow
sudo pip3 uninstall tensorflow==1.4.0
strong@foreverstrong:~$ sudo pip3 uninstall tensorflow==
[sudo] password for strong:
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling tensorflow-1.7.0:
/usr/local/bin/freeze_graph
/usr/local/bin/saved_model_cli
/usr/local/bin/tensorboard
/usr/local/bin/toco
/usr/local/bin/toco_from_protos
/usr/local/lib/python3.5/dist-packages/external/__init__.py
/usr/local/lib/python3.5/dist-packages/external/__pycache__/__init__.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/__init__.py
/usr/local/lib/python3.5/dist-packages/external/absl_py/__pycache__/__init__.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/__init__.py
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/__pycache__/__init__.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/LICENSE
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/__init__.py
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/__pycache__/__init__.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/__pycache__/_argument_parser.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/__pycache__/_defines.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/__pycache__/_exceptions.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/__pycache__/_flag.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/__pycache__/_flagvalues.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/__pycache__/_helpers.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/__pycache__/_validators.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/_argument_parser.py
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/_defines.py
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/_exceptions.py
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/_flag.py
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/_flagvalues.py
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/_helpers.py
/usr/local/lib/python3.5/dist-packages/external/absl_py/absl/flags/_validators.py
/usr/local/lib/python3.5/dist-packages/external/arm_neon_2_x86_sse/LICENSE
/usr/local/lib/python3.5/dist-packages/external/astor_archive/LICENSE
/usr/local/lib/python3.5/dist-packages/external/astor_archive/__init__.py
/usr/local/lib/python3.5/dist-packages/external/astor_archive/__pycache__/__init__.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__init__.py
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/__init__.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/code_gen.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/codegen.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/file_util.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/node_util.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/op_util.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/rtrip.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/source_repr.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/string_repr.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/__pycache__/tree_walk.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/external/astor_archive/astor/code_gen.py
......
/usr/local/lib/python3.5/dist-packages/tensorflow/tools/pip_package/simple_console.py
Proceed (y/n)? y
Successfully uninstalled tensorflow-1.7.0
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 8.1.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
3.1. sudo pip3 uninstall tensorflow-tensorboard
strong@foreverstrong:~$ pip3 list | grep tensorflow
tensorflow-tensorboard (0.4.0rc3)
You are using pip version 8.1.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
strong@foreverstrong:~$ sudo pip3 uninstall tensorflow-tensorboard
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling tensorflow-tensorboard-0.4.0rc3:
/usr/local/lib/python3.5/dist-packages/tensorboard/__init__.py
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/__init__.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/data_compat.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/db.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/default.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/main.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/plugin_util.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/program.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/summary.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/util.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/__pycache__/version.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/__init__.py
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/__pycache__/__init__.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/__pycache__/application.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/__pycache__/http_util.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/__pycache__/json_util.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/__pycache__/process_graph.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/application.py
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__init__.py
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/__init__.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/directory_watcher.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/event_accumulator.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/event_file_inspector.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/event_file_loader.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/event_multiplexer.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/io_wrapper.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/plugin_asset_util.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/plugin_event_accumulator.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/plugin_event_multiplexer.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/__pycache__/reservoir.cpython-35.pyc
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/directory_watcher.py
/usr/local/lib/python3.5/dist-packages/tensorboard/backend/event_processing/event_accumulator.py
......
/usr/local/lib/python3.5/dist-packages/tensorflow_tensorboard-0.4.0rc3.dist-info/top_level.txt
Proceed (y/n)? y
Successfully uninstalled tensorflow-tensorboard-0.4.0rc3
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 8.1.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
3.2. 核实卸载
strong@foreverstrong:~$ pip3 list | grep tensorflow
You are using pip version 8.1.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
strong@foreverstrong:~$ pip list | grep tensorflow
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
tensorflow-gpu 1.4.0
tensorflow-tensorboard 0.4.0
You are using pip version 18.0, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
strong@foreverstrong:~$
References
[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/