【问题标题】:pycaffe 'solver.step' fails to train using Adampycaffe 'solver.step' 无法使用 Adam 进行训练
【发布时间】:2017-11-02 10:14:05
【问题描述】:

我正在尝试使用 pycaffe 训练模型。我使用亚当优化器 前向和后向代码工作正常:

solver.net.forward()
solver.net.backward()

但是在更新步骤 (solver.update()) 上失败并出现以下错误:

AttributeError: 'AdamSolver' object has no attribute 'update'
F1102 12:14:25.689537 24420 benchmark.cpp:18] Check failed: error == cudaSuccess (10 vs. 0) invalid device ordinal

当我尝试solver.step(1) 时,我给了我:

solver.step(1) failed to work with the following error: 
F1101 19:28:43.213888  5038 benchmark.cpp:30] Check failed: error == cudaSuccess (71 vs. 0)  operation not supported
*** Check failure stack trace: ***
Aborted (core dumped)

我怀疑存在安装问题,实际上我的运行测试中很少有测试用例失败,这是否相关以及如果我需要重建需要修复什么?

编辑 1: 我修复了运行测试中的所有问题,但仍然遇到同样的问题。

【问题讨论】:

  • 哪些测试失败了?您需要提供更多信息。目前您的 GPU 似乎不支持 caffe 预期的 CUDA 版本。
  • 以下是失败的测试,我修复了它.. 现在尝试重建并查找它是否可以解决此问题stackoverflow.com/questions/47073514/caffe-runtest-fails/…
  • 仍然失败..所有测试用例运行成功
  • 您的机器上是否有多个 GPU?这两个错误仍然发生吗?
  • 我使用caffe.set_device(0),所以我相信这不是多 GPU 问题,而且无论如何它只有一个 GPU

标签: caffe pycaffe


【解决方案1】:

caffe.set_mode_gpu()caffe.set_device(0) 放在caffe.get_solver(solver_path) 解决问题之前。

【讨论】:

    猜你喜欢
    • 2017-07-13
    • 1970-01-01
    • 2019-10-18
    • 1970-01-01
    • 2021-10-03
    • 2018-07-20
    • 2020-01-12
    • 2020-05-21
    • 2016-09-24
    相关资源
    最近更新 更多