pycaffe'solver.step'无法使用Adam进行训练

时间:2017-11-02 10:14:05

标签: caffe pycaffe

我正在尝试使用pycaffe训练模型。我使用Adam Optimizer 前向和后向代码工作正常:

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: 我修复了运行测试中的所有问题,但仍然遇到了同样的问题。

1 个答案:

答案 0 :(得分:1)

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