【发布时间】:2018-09-22 09:38:56
【问题描述】:
我有一个求解器文件,如下所示。
train_net: "../Prototxtfiles/VGGNet/train.prototxt"
test_net: "../Prototxtfiles/VGGNet/test.prototxt"
test_iter: 172
test_interval: 1000
base_lr: 0.0010000000475
display: 10
max_iter: 30000
lr_policy: "multistep"
gamma: 0.10000000149
momentum: 0.899999976158
weight_decay: 0.000500000023749
snapshot: 5000
snapshot_prefix: "../Prototxtfiles/VGGNet/CROWDSENSING_SSD_500x500"
solver_mode: GPU
device_id: 0
debug_info: false
snapshot_after_train: true
test_initialization: false
average_loss: 10
stepvalue: 10000
stepvalue: 20000
stepvalue: 30000
iter_size: 4
type: "SGD"
eval_type: "detection"
ap_version: "11point"
我尝试使用下面的代码读取文件
bool ReadProtoFromTextFile(const char* filename, Message* proto) {
int fd = open(filename, O_RDONLY);
CHECK_NE(fd, -1) << "File not found: " << filename;
google::protobuf::io::FileInputStream* input = new FileInputStream(fd);
bool success = google::protobuf::TextFormat::Parse(input, proto);
delete input;
close(fd);
return success;
}
我无法在 Windows 中解析,但它可以在 Linux 中使用。 可能是什么问题?
编辑:
可能是什么问题?我可以使用相同的代码读取这个 prototxt 文件。
net: "models/bvlc_googlenet/train_val.prototxt"
test_iter: 1000
test_interval: 4000
test_initialization: false
display: 40
average_loss: 40
base_lr: 0.01
lr_policy: "step"
stepsize: 320000
gamma: 0.96
max_iter: 10000000
momentum: 0.9
weight_decay: 0.0002
snapshot: 40000
snapshot_prefix: "models/bvlc_googlenet/bvlc_googlenet"
solver_mode: GPU
【问题讨论】:
-
您到底遇到了什么错误?你为 Windows 编译了
caffe.proto吗?你能在windows上阅读其他prototxt文件吗?
标签: deep-learning protocol-buffers caffe