【问题标题】:Tensorflow Object Detection API ( TF 2.0) GPU not workingTensorflow 对象检测 API(TF 2.0)GPU 不工作
【发布时间】:2019-12-03 12:59:04
【问题描述】:

我正在尝试从https://github.com/tensorflow/models/tree/master/research/object_detection 运行对象检测 API。 我已经按照说明安装了 API。

当使用 GPU 运行 object_detection_tutorial.ipynb 时,没有发生任何事情 for image_path in TEST_IMAGE_PATHS: show_inference(detection_model, image_path) 一段时间后内核就死了。

但是,当我使用 CPU 时,相同的代码正在运行。

以下是我机器的配置:

  • Windows 10
  • TF2.0.0
  • CUDA:10.0.130
  • cuDNN:7.6.4
  • 显卡:GeForce GTX 1050

【问题讨论】:

  • 检查您的终端或 anaconda 提示以查看正在生成的错误消息。作为参考,我在以下位置运行大型模型时收到“UnknownError: Failed to get convolution algorithm。这可能是因为 cuDNN 无法初始化”:tensorflow-gpu 2.0 CUDA 10.0 cuDNN 7.6.5 最终将 cuDNN 降级为 7.6.2 和模型现在正在无错误地训练。我没有技术能力来解释发生了什么,除了在 tensorflow-gpu 2.0 上尝试不同版本的 CUDA 和 cuDNN 时我很幸运。
  • @iatechicken 在 Windows 上不支持调用 ptxas 依赖驱动程序执行 ptx 编译。此消息只会记录一次。-- 这是在终端停止之前出现的消息。
  • 所以...昨晚我不得不卸载并重新安装 tensorflow-gpu 2.0,然后我开始遇到相同的“调用 Windows 不支持的 ptxas”错误。不幸的是,这看起来像是 TF 上最近的一个公开问题。 github.com/tensorflow/models/issues/7640
  • @iatechicken 您是否偶然尝试过旧版本的 TensorFlow 和 Cuda/Cudnn?
  • 还没有。但我认为我们在同一页上......对我来说,我在考虑以下 3 个选项:[1] 将 CUDA 升级到 10.1(在降级到 10.0 之前我已经失败了 10.2)[2] 将 tensorflow 升级到nightly 或 2.0 alpha [3] 将 tensorflow 降级到 1.x 版本(不确定哪个最稳定)

标签: python tensorflow


【解决方案1】:

使用以下配置(windows 10、cuda 10.0.13、cudnn 7.6.3、Tensorflow 2.0.0、GTX 1050 笔记本电脑)我在启动最终代码部分时添加了一个与 jupyter notebook 类似的问题:

for image_path in TEST_IMAGE_PATHS:
   show_inference(detection_model, image_path)

代码启动,然后内核失败。在 cmd 上使用 nvidia-smi 可以看到代码向 GPU 传输了多达 90% 的功能。但正如在命令提示符中看到的那样,由于内存不足,它失败了。 GTX 1050 无法满足这种类型的计算

 2020-02-16 09:41:45.057354: W tensorflow/core/common_runtime/bfc_allocator.cc:239] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.93GiB with freed_by_count=0. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.

【讨论】:

    猜你喜欢
    • 2021-06-08
    • 2020-11-02
    • 2020-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多