Tensorflow GPU安装错误

时间:2020-09-08 21:08:59

标签: python tensorflow tensorflow2.0

我当前正在尝试在此视频之后为Windows安装Tensorflow GPU: https://www.youtube.com/watch?v=qrkEYf-YDyI&t=552s&ab_channel=JeffHeaton

我正在使用nvidia geforce gtx 970,并为此安装了可用于游戏的驱动程序。 我已经为CUDA 10.0安装了CUDA ToolKit 10.0和cuDNN 7.6.4。 我已将所有路径添加到环境变量,当我尝试通过运行以下yml文件创建新环境时,出现此错误:

name tensorflow
 
dependencies
    - python=3.7
    - pip=19.0
    - jupyter
    - tensorflow-gpu=2.1.0
    - scikit-learn
    - scipy
    - pandas
    - pandas-datareader
    - matplotlib
    - pillow
    - tqdm
    - requests
    - h5py
    - pyyaml
    - flask
    - boto3
    - pip
        - bayesian-optimization
        - gym
        - kaggle
        

C:\Users\Thomas\Documents>conda env create -v -f tensorflow-gpu.yml

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "C:\Users\Thomas\miniconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "C:\Users\Thomas\miniconda3\lib\site-packages\conda_env\cli\main.py", line 80, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "C:\Users\Thomas\miniconda3\lib\site-packages\conda_env\cli\main_create.py", line 86, in execute
        spec = specs.detect(name=name, filename=filename, directory=os.getcwd())
      File "C:\Users\Thomas\miniconda3\lib\site-packages\conda_env\specs\__init__.py", line 43, in detect
        if spec.can_handle():
      File "C:\Users\Thomas\miniconda3\lib\site-packages\conda_env\specs\yaml_file.py", line 18, in can_handle
        self._environment = env.from_file(self.filename)
      File "C:\Users\Thomas\miniconda3\lib\site-packages\conda_env\env.py", line 157, in from_file
        return from_yaml(yamlstr, filename=filename)
      File "C:\Users\Thomas\miniconda3\lib\site-packages\conda_env\env.py", line 139, in from_yaml
        data = validate_keys(data, kwargs)
      File "C:\Users\Thomas\miniconda3\lib\site-packages\conda_env\env.py", line 37, in validate_keys
        new_data = data.copy() if data else {}
    AttributeError: 'str' object has no attribute 'copy'

`$ C:\Users\Thomas\miniconda3\Scripts\conda-env-script.py create -v -f tensorflow-gpu.yml`

  environment variables:
                 CIO_TEST=<not set>
  CONDA_AUTO_UPDATE_CONDA=false
                CONDA_EXE=C:\Users\Thomas\miniconda3\condabin\..\Scripts\conda.exe
               CONDA_EXES="C:\Users\Thomas\miniconda3\condabin\..\Scripts\conda.exe"
               CONDA_ROOT=C:\Users\Thomas\miniconda3
                CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
           CURL_CA_BUNDLE=<not set>
                 HOMEPATH=\Users\Thomas
          NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
                     PATH=C:\Users\Thomas\miniconda3;C:\Users\Thomas\miniconda3\Library\mingw-w6
                          4\bin;C:\Users\Thomas\miniconda3\Library\usr\bin;C:\Users\Thomas\minic
                          onda3\Library\bin;C:\Users\Thomas\miniconda3\Scripts;C:\Users\Thomas\m
                          iniconda3\bin;C:\Program Files\NVIDIA GPU Computing
                          Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\C
                          UDA\v10.0\libnvvp;;C:\Windows\system32;C:\Windows;C:\Windows\System32\
                          Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\O
                          penSSH\;C:\Program Files (x86)\NVIDIA
                          Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA Nv
                          DLISR;C:\Users\Thomas\miniconda3;C:\Users\Thomas\miniconda3\Library\mi
                          ngw-w64\bin;C:\Users\Thomas\miniconda3\Library\usr\bin;C:\Users\Thomas
                          \miniconda3\Library\bin;C:\Users\Thomas\miniconda3\Scripts;C:\Users\Th
                          omas\AppData\Local\Programs\Python\Python38-32;C:\Users\Thomas\AppData
                          \Local\Programs\Python\Python38-32\Scripts;C:\Program Files\NVIDIA GPU
                          Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing
                          Toolkit\CUDA\v10.0\extras\CUPTI\libx64;C:\Program Files\NVIDIA GPU
                          Computing Toolkit\CUDA\v10.0\include;C:\tools\cuda\bin;C:\tools\Tensor
                          RT-6.0.1.5;C:\Users\Thomas\AppData\Local\Microsoft\WindowsApps;
             PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\Windows
                          PowerShell\v1.0\Modules
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : None
       user config file : C:\Users\Thomas\.condarc
 populated config files :
          conda version : 4.8.4
    conda-build version : not installed
         python version : 3.8.3.final.0
       virtual packages : __cuda=11.0
       base environment : C:\Users\Thomas\miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\Thomas\miniconda3\pkgs
                          C:\Users\Thomas\.conda\pkgs
                          C:\Users\Thomas\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\Thomas\miniconda3\envs
                          C:\Users\Thomas\.conda\envs
                          C:\Users\Thomas\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.8.4 requests/2.23.0 CPython/3.8.3 Windows/10 Windows/10.0.19041
          administrator : False
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

1 个答案:

答案 0 :(得分:0)

检查是否安装了正确匹配的CUDA和Tensorflow GPU版本。 如此处所引用:https://www.tensorflow.org/install/source_windows#tested_build_configurations

enter image description here

tensorflow_gpu 2.1.0需要cuDNN 7.4和CUDA 10.1而非CUDA 10.0