在Windows 10上安装tensorflow-gpu时出错:不可满足错误:发现以下规范彼此不兼容

oalqel3c  于 2022-12-13  发布在  Windows
关注(0)|答案(1)|浏览(185)

为了在Windows 10机器上安装TensorFlow-gpu,我按照这个非常详细的https://medium.com/analytics-vidhya/tensorflow-2-3-0-with-gpu-support-on-windows-10-f975a552ea7c后的步骤一步一步地安装,但是我在安装库tensorflow-gpu的步骤上卡住了(我之前已经卸载了已经存在的tensorflow一个)。我试图用conda和pip 3命令安装它,但是我总是得到这个错误

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

在此之前,当我尝试使用conda installa命令进行安装时,我得到以下结果

(mltrade2GPU) D:\Dropbox\PROJECTS\MLTrading>conda install tensorflow-gpu
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.-
Examining @/win-64::__cuda==11.8=0:   0%|                                                        | 0/5 [00:00<?, ?it/s]-failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

而用PIP 3代替

(mltrade2GPU) D:\Dropbox\PROJECTS\MLTrading>pip3 install tensorflow-gpu
Collecting tensorflow-gpu
  Downloading tensorflow_gpu-2.10.1-cp310-cp310-win_amd64.whl (455.9 MB)
     ---------------------------------------- 455.9/455.9 MB 1.6 MB/s eta 0:00:00
Requirement already satisfied: wrapt>=1.11.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (1.14.1)
Collecting libclang>=13.0.0
  Downloading libclang-14.0.6-py2.py3-none-win_amd64.whl (14.2 MB)
     ---------------------------------------- 14.2/14.2 MB 3.7 MB/s eta 0:00:00
Collecting gast<=0.4.0,>=0.2.1
  Downloading gast-0.4.0-py3-none-any.whl (9.8 kB)
Requirement already satisfied: termcolor>=1.1.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (2.1.1)
Requirement already satisfied: keras-preprocessing>=1.1.1 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (1.1.2)
Collecting tensorflow-io-gcs-filesystem>=0.23.1
  Downloading tensorflow_io_gcs_filesystem-0.28.0-cp310-cp310-win_amd64.whl (1.5 MB)
     ---------------------------------------- 1.5/1.5 MB 3.1 MB/s eta 0:00:00
Requirement already satisfied: astunparse>=1.6.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (1.6.3)
Requirement already satisfied: h5py>=2.9.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (3.7.0)
Collecting keras<2.11,>=2.10.0
  Downloading keras-2.10.0-py2.py3-none-any.whl (1.7 MB)
     ---------------------------------------- 1.7/1.7 MB 11.9 MB/s eta 0:00:00
Requirement already satisfied: typing-extensions>=3.6.6 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (4.3.0)
Requirement already satisfied: google-pasta>=0.1.1 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (0.2.0)
Requirement already satisfied: flatbuffers>=2.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (2.0)
Requirement already satisfied: numpy>=1.20 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (1.21.6)
Collecting tensorboard<2.11,>=2.10
  Downloading tensorboard-2.10.1-py3-none-any.whl (5.9 MB)
     ---------------------------------------- 5.9/5.9 MB 3.9 MB/s eta 0:00:00
Requirement already satisfied: setuptools in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (65.5.0)
Requirement already satisfied: six>=1.12.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (1.16.0)
Requirement already satisfied: packaging in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (21.3)
Collecting tensorflow-estimator<2.11,>=2.10.0
  Downloading tensorflow_estimator-2.10.0-py2.py3-none-any.whl (438 kB)
     ---------------------------------------- 438.7/438.7 kB 4.6 MB/s eta 0:00:00
Requirement already satisfied: opt-einsum>=2.3.2 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (3.3.0)
Collecting protobuf<3.20,>=3.9.2
  Downloading protobuf-3.19.6-cp310-cp310-win_amd64.whl (895 kB)
     ---------------------------------------- 895.7/895.7 kB 28.6 MB/s eta 0:00:00
Requirement already satisfied: grpcio<2.0,>=1.24.3 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (1.42.0)
Requirement already satisfied: absl-py>=1.0.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorflow-gpu) (1.3.0)
Requirement already satisfied: wheel<1.0,>=0.23.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from astunparse>=1.6.0->tensorflow-gpu) (0.37.1)
Requirement already satisfied: markdown>=2.6.8 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorboard<2.11,>=2.10->tensorflow-gpu) (3.4.1)
Requirement already satisfied: werkzeug>=1.0.1 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorboard<2.11,>=2.10->tensorflow-gpu) (2.2.2)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorboard<2.11,>=2.10->tensorflow-gpu) (0.4.6)
Requirement already satisfied: requests<3,>=2.21.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorboard<2.11,>=2.10->tensorflow-gpu) (2.28.1)
Requirement already satisfied: google-auth<3,>=1.6.3 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorboard<2.11,>=2.10->tensorflow-gpu) (2.14.1)
Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorboard<2.11,>=2.10->tensorflow-gpu) (0.6.0)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from tensorboard<2.11,>=2.10->tensorflow-gpu) (1.8.1)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from packaging->tensorflow-gpu) (3.0.9)
Requirement already satisfied: rsa<5,>=3.1.4 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow-gpu) (4.9)
Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow-gpu) (0.2.7)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow-gpu) (5.2.0)
Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.11,>=2.10->tensorflow-gpu) (1.3.1)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.11,>=2.10->tensorflow-gpu) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.11,>=2.10->tensorflow-gpu) (1.26.13)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.11,>=2.10->tensorflow-gpu) (2022.9.24)
Requirement already satisfied: idna<4,>=2.5 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.11,>=2.10->tensorflow-gpu) (3.4)
Requirement already satisfied: MarkupSafe>=2.1.1 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from werkzeug>=1.0.1->tensorboard<2.11,>=2.10->tensorflow-gpu) (2.1.1)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow-gpu) (0.4.8)
Requirement already satisfied: oauthlib>=3.0.0 in c:\users\federico\anaconda3\envs\mltrade2gpu\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.11,>=2.10->tensorflow-gpu) (3.2.2)
Installing collected packages: libclang, keras, tensorflow-io-gcs-filesystem, tensorflow-estimator, protobuf, gast, tensorboard, tensorflow-gpu
  Attempting uninstall: keras
    Found existing installation: keras 2.9.0
    Uninstalling keras-2.9.0:
      Successfully uninstalled keras-2.9.0
  Attempting uninstall: tensorflow-estimator
    Found existing installation: tensorflow-estimator 2.9.0
    Uninstalling tensorflow-estimator-2.9.0:
      Successfully uninstalled tensorflow-estimator-2.9.0
  Attempting uninstall: protobuf
    Found existing installation: protobuf 3.20.1
    Uninstalling protobuf-3.20.1:
      Successfully uninstalled protobuf-3.20.1
  Attempting uninstall: gast
    Found existing installation: gast 0.5.3
    Uninstalling gast-0.5.3:
      Successfully uninstalled gast-0.5.3
  Attempting uninstall: tensorboard
    Found existing installation: tensorboard 2.9.0
    Uninstalling tensorboard-2.9.0:
      Successfully uninstalled tensorboard-2.9.0
ERROR: Could not install packages due to an OSError: [WinError 5] Accesso negato: 'C:\\Users\\Federico\\anaconda3\\envs\\mltrade2GPU\\Lib\\site-packages\\tensorflow\\compiler\\tf2tensorrt\\_pywrap_py_utils.pyd'
Consider using the `--user` option or check the permissions.
dldeef67

dldeef671#

tensorflow-gpu与您当前安装的CUDA版本之间存在版本冲突。您需要CUDA 11.0才能运行,但您安装的是CUDA 11.8。
要么安装特定的CUDA版本,要么适应特定的tensorflow-gpu软件包版本。根据PyPI站点,版本2.10.1应该是正确的:一米三一米!

相关问题