【问题标题】:Errors with tensorflow-gpu 2.0alpha0tensorflow-gpu 2.0alpha0 的错误
【发布时间】:2019-04-02 15:55:31
【问题描述】:

我在 Windows 10 中安装了 tensorflow-gpu 2.0alpha0、cudatoolkit 10.0.130 和 cudnn 7.5。

TensorFlow 2.0 在 CPU 上运行良好,但在 GPU 上运行时遇到错误。

错误信息如下:

2019-04-02 23:47:38.646661: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-04-02 23:47:38.666653: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2019-04-02 23:47:38.666842: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)

我认为主要问题是“Could not dlopen library 'nvcuda.dll'”。

但是,我已经安装了最新的 NVIDIA 驱动程序(版本 419.67),并且可以在 C:\Windows\System32\nvcuda.dll 中找到“nvcuda.dll”。

【问题讨论】:

  • 你设置路径了吗 SET PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;%PATH% SET PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\CUPTI\libx64;%PATH% SET PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include;%PATH% SET PATH=C:\tools\ cuda\bin;%PATH%

标签: tensorflow tensorflow2.0


【解决方案1】:

正是这种方法在 TensorFlow 中失败了:

    port::StatusOr<void*> GetDsoHandle(const string& name, const string& version) {
        auto filename = port::Env::Default()->FormatLibraryFileName(name, version);
        void* dso_handle;
        port::Status status =
          port::Env::Default()->LoadLibrary(filename.c_str(), &dso_handle);
        if (status.ok()) {
            LOG(INFO) << "Successfully opened dynamic library " << filename;
            return dso_handle;
    }

基本上,这意味着 Tensorflow 在你的 windows 环境中无法从 PATH 变量中找到 nvcuda。要添加环境变量,请执行以下操作:

Windows 10 和 Windows 8

  1. 在搜索中,搜索然后选择:系统(控制面板)
  2. 点击高级系统设置链接。
  3. 单击环境变量。在系统变量部分中,找到 PATH 环境变量并选择它。点击编辑。
  4. 如果 PATH 环境变量不存在,请单击新建。
  5. 在编辑系统变量(或新系统变量)窗口中,添加路径值 C:\Windows\System32\nvcuda.dll。单击确定。单击“确定”关闭所有剩余的窗口。

PS:确保你已经安装了cuDNN

【讨论】:

  • 谢谢你的回答,我试过了,还是不行。存在相同的错误。
  • 你安装了cuDNN吗?
猜你喜欢
  • 2017-11-27
  • 1970-01-01
  • 2023-03-14
  • 1970-01-01
  • 1970-01-01
  • 2021-04-28
  • 2018-04-10
  • 2017-12-26
  • 2019-05-14
相关资源
最近更新 更多