我想为 Anaconda Python 3.6 安装 Tensorflow-GPU。
我怎样才能解决这个问题?
$ conda install -c anaconda tensorflow-gpu
Solving environment: failed
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 819, in __call__
return func(*args, **kwargs)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 77, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
install(args, parser, 'install')
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/cli/install.py", line 235, in install
force_reinstall=context.force,
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/solve.py", line 518, in solve_for_transaction
force_remove, force_reinstall)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/solve.py", line 451, in solve_for_diff
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/solve.py", line 180, in solve_final_state
index, r = self._prepare(prepared_specs)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/solve.py", line 592, in _prepare
self.subdirs, prepared_specs)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/index.py", line 215, in get_reduced_index
new_records = query_all(spec)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/index.py", line 184, in query_all
return tuple(concat(future.result() for future in as_completed(futures)))
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 95, in query
self.load()
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 149, in load
_internal_state = self._load()
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 218, in _load
mod_etag_headers.get('_mod'))
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 280, in _read_local_repdata
_internal_state = self._process_raw_repodata_str(raw_repodata_str)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 369, in _process_raw_repodata_str
info['fn'] = fn
TypeError: 'NoneType' object does not support item assignment
`$ /scratch/sjn-p3/anaconda/anaconda3/bin/conda install -c anaconda tensorflow-gpu`
environment variables:
CIO_TEST=<not set>
CONDA_ROOT=/scratch/sjn-p3/anaconda/anaconda3
CONDA_SHLVL=0
MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles
PATH=/scratch2/system/opt/pycharm-community-2018.1.2/bin:/scratch2/google-
cloud-sdk/bin:/scratch2/google-cloud-sdk/bin:/scratch/sjn-p3/anaconda/
anaconda3/bin:/scratch2/system/opt/pycharm-
community-2018.1.2/bin:/scratch2/google-cloud-
sdk/bin:/scratch2/google-cloud-sdk/bin:/scratch/sjn-p3/anaconda//anaco
nda3/bin:/scratch2/system/opt/pycharm-
community-2018.1.2/bin:/scratch2/google-cloud-
sdk/bin:/scratch2/google-cloud-sdk/bin:/scratch/sjn/anaconda/bin:/usr/
lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bi
n:/sbin:/usr/local/IT/bin:/home/grad3/jalal/bin:/scratch/sjn-p2/anacon
da/anaconda2/bin
PYTHONPATH=:/scratch2/body_pose/tf-
openpose/src/tensorpack:/scratch2/body_pose/tf-openpose/src/tensorpack
QT_PLUGIN_PATH=/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>
WINDOWPATH=1
active environment : None
shell level : 0
user config file : /home/grad3/jalal/.condarc
populated config files : /home/grad3/jalal/.condarc
conda version : 4.5.11
conda-build version : 3.2.2
python version : 3.6.4.final.0
base environment : /scratch/sjn-p3/anaconda/anaconda3 (read only)
channel URLs : https://conda.anaconda.org/anaconda/linux-64
https://conda.anaconda.org/anaconda/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/linux-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/linux-64
https://repo.anaconda.com/pkgs/pro/noarch
package cache : /scratch/sjn-p3/anaconda/anaconda3/pkgs
/home/grad3/jalal/.conda/pkgs
envs directories : /home/grad3/jalal/.conda/envs
/scratch/sjn-p3/anaconda/anaconda3/envs
platform : linux-64
user-agent : conda/4.5.11 requests/2.18.4 CPython/3.6.4 Linux/3.10.0-862.14.4.el7.x86_64 centos/7 glibc/2.17
UID:GID : 275735:3935
netrc file : None
offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?
[y/N]: y
Upload successful.
Thank you for helping to improve conda.
Opt-in to always sending reports (and not see this message again)
by running
$ conda config --set report_errors true
使用 pip 我收到以下错误:
[jalal@goku pset3_CNN]$ pip install tensorflow-gpu
Collecting tensorflow-gpu
Using cached https://files.pythonhosted.org/packages/25/52/01438b81806765936eee690709edc2a975472c4e9d8d465a01840869c691/tensorflow_gpu-1.11.0-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied: wheel>=0.26 in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from tensorflow-gpu)
Requirement already satisfied: six>=1.10.0 in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from tensorflow-gpu)
Collecting gast>=0.2.0 (from tensorflow-gpu)
Requirement already satisfied: numpy>=1.13.3 in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from tensorflow-gpu)
Collecting tensorboard<1.12.0,>=1.11.0 (from tensorflow-gpu)
Using cached https://files.pythonhosted.org/packages/9b/2f/4d788919b1feef04624d63ed6ea45a49d1d1c834199ec50716edb5d310f4/tensorboard-1.11.0-py3-none-any.whl
Collecting protobuf>=3.6.0 (from tensorflow-gpu)
Using cached https://files.pythonhosted.org/packages/c2/f9/28787754923612ca9bfdffc588daa05580ed70698add063a5629d1a4209d/protobuf-3.6.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting keras-applications>=1.0.5 (from tensorflow-gpu)
Using cached https://files.pythonhosted.org/packages/3f/c4/2ff40221029f7098d58f8d7fb99b97e8100f3293f9856f0fb5834bef100b/Keras_Applications-1.0.6-py2.py3-none-any.whl
Requirement already satisfied: setuptools<=39.1.0 in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from tensorflow-gpu)
Collecting termcolor>=1.1.0 (from tensorflow-gpu)
Collecting absl-py>=0.1.6 (from tensorflow-gpu)
Collecting keras-preprocessing>=1.0.3 (from tensorflow-gpu)
Using cached https://files.pythonhosted.org/packages/fc/94/74e0fa783d3fc07e41715973435dd051ca89c550881b3454233c39c73e69/Keras_Preprocessing-1.0.5-py2.py3-none-any.whl
Collecting astor>=0.6.0 (from tensorflow-gpu)
Using cached https://files.pythonhosted.org/packages/35/6b/11530768cac581a12952a2aad00e1526b89d242d0b9f59534ef6e6a1752f/astor-0.7.1-py2.py3-none-any.whl
Collecting grpcio>=1.8.6 (from tensorflow-gpu)
Using cached https://files.pythonhosted.org/packages/a7/9c/523fec4e50cd4de5effeade9fab6c1da32e7e1d72372e8e514274ffb6509/grpcio-1.15.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting markdown>=2.6.8 (from tensorboard<1.12.0,>=1.11.0->tensorflow-gpu)
Using cached https://files.pythonhosted.org/packages/7a/6b/5600647404ba15545ec37d2f7f58844d690baf2f81f3a60b862e48f29287/Markdown-3.0.1-py2.py3-none-any.whl
Requirement already satisfied: werkzeug>=0.11.10 in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from tensorboard<1.12.0,>=1.11.0->tensorflow-gpu)
Requirement already satisfied: h5py in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from keras-applications>=1.0.5->tensorflow-gpu)
Installing collected packages: gast, protobuf, markdown, grpcio, tensorboard, keras-applications, termcolor, absl-py, keras-preprocessing, astor, tensorflow-gpu
Exception:
Traceback (most recent call last):
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/gast'
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[jalal@goku pset3_CNN]$ sudo pip install tensorflow-gpu
[sudo] password for jalal:
Requirement already satisfied: tensorflow-gpu in /usr/lib64/python2.7/site-packages (1.1.0)
Requirement already satisfied: wheel in /usr/lib/python2.7/site-packages (from tensorflow-gpu) (0.31.0)
Requirement already satisfied: mock>=2.0.0 in /usr/lib/python2.7/site-packages (from tensorflow-gpu) (2.0.0)
Requirement already satisfied: numpy>=1.11.0 in /usr/lib64/python2.7/site-packages (from tensorflow-gpu) (1.13.3)
Requirement already satisfied: werkzeug>=0.11.10 in /usr/lib64/python2.7/site-packages (from tensorflow-gpu) (0.14.1)
Requirement already satisfied: six>=1.10.0 in /usr/lib/python2.7/site-packages (from tensorflow-gpu) (1.11.0)
Requirement already satisfied: protobuf>=3.2.0 in /usr/lib64/python2.7/site-packages (from tensorflow-gpu) (3.5.2.post1)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in /usr/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow-gpu) (1.0.2)
Requirement already satisfied: pbr>=0.11 in /usr/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow-gpu) (3.1.1)
Requirement already satisfied: setuptools in /usr/lib/python2.7/site-packages (from protobuf>=3.2.0->tensorflow-gpu) (0.9.8)
rtslib-fb 2.1.63 has requirement pyudev>=0.16.1, but you'll have pyudev 0.15 which is incompatible.
matplotlib 2.2.2 has requirement python-dateutil>=2.1, but you'll have python-dateutil 1.5 which is incompatible.
bleach 2.1.3 has requirement html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre, but you'll have html5lib 1.0b8 which is incompatible.
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[jalal@goku pset3_CNN]$ python -c "import tensorflow"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow'
答案1
使用conda install python=3.6 tensorflow-gpu
。
(我已在 尝试过anaconda3-5.2.0
。)