训练caffe:registry.count(type) == 0 (1 vs. 0) Solver type Nesterov already registered

本文解决了一个关于Caffe训练过程中出现的Solver类型已注册错误及Protocol Buffers版本不匹配问题。通过调整PYTHONPATH环境变量并统一Protocol Buffers版本解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

命令:./continue-train.sh

内容:../../caffe-master/build/tools/caffe train -gpu=$1 -solver=solver.prototxt  2>&1 | tee $LOG

错误:

I0425 08:26:13.348503 19309 layer_factory.hpp:77] Creating layer input_layer
F0425 08:26:13.412329 19309 solver_factory.hpp:67] Check failed: registry.count(type) == 0 (1 vs. 0) Solver type Nesterov already registered.

解决问题网址:https://groups.google.com/forum/#!topic/caffe-users/Pqs2xNKO9X4

猜测是PYTHONPATH的问题,因为这里我copy了一份caffe,我使用的是copy之后的caffe,但是没有将它加到PYTHONPATH里.

 

猜测是对的.vim ~/.bashrc,   source~/.bashrc.

错误:

This program requires version 3.4.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/descriptor.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException

参考网址:https://github.com/BVLC/caffe/issues/5711

我的解决方法:

protoc --version: 得到的版本是2.6.1, 但是pip中安装的protobuf 是3.4.0版本的.所以可能是这两个版本不匹配造成的.

sudo pip uninstall protobuf

sudo pip install protobuf==2.6.1

现在可以正常训练了.

 

转载于:https://www.cnblogs.com/benbencoding798/p/8939750.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值