我正在尝试使用cifar10网络层来训练CNN和我自己的数据。 但是,当我运行这个命令时:
roishik@roishik-System-Product-Name:~/Desktop/caffe/caffe$ /home/roishik/Desktop/caffe/caffe/build/tools/caffe train --solver /home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_solver.prototxt 2>&1 | tee /home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_train_test.prototxt
我收到此错误消息:
I0726 22:01:40.884320 6596 caffe.cpp:210] Use CPU.
I0726 22:01:40.884771 6596 solver.cpp:48] Initializing solver from parameters:
test_iter: 100
test_interval: 500
base_lr: 0.001
display: 100
max_iter: 4000
lr_policy: "fixed"
momentum: 0.9
weight_decay: 0.004
snapshot: 4000
snapshot_prefix: "/home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar_10_fast"
solver_mode: CPU
net: "/home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_train_test.prototxt"
train_state {
level: 0
stage: ""
}
snapshot_format: HDF5
I0726 22:01:40.885051 6596 solver.cpp:91] Creating training net from net file: /home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_train_test.prototxt
[libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 1:7: Message type "caffe.NetParameter" has no field named "I0726".
F0726 22:01:40.885253 6596 upgrade_proto.cpp:79] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: /home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_train_test.prototxt
*** Check failure stack trace: ***
@ 0x7f0f10ad5daa (unknown)
@ 0x7f0f10ad5ce4 (unknown)
@ 0x7f0f10ad56e6 (unknown)
@ 0x7f0f10ad8687 (unknown)
@ 0x7f0f10f614be caffe::ReadNetParamsFromTextFileOrDie()
@ 0x7f0f10fc6acb caffe::Solver<>::InitTrainNet()
@ 0x7f0f10fc7b9c caffe::Solver<>::Init()
@ 0x7f0f10fc7eca caffe::Solver<>::Solver()
@ 0x7f0f10fa2473 caffe::Creator_SGDSolver<>()
@ 0x40eb6e caffe::SolverRegistry<>::CreateSolver()
@ 0x407d4b train()
@ 0x40589c main
@ 0x7f0f0fae1f45 (unknown)
@ 0x40610b (unknown)
@ (nil) (unknown)
我在谷歌搜索并没有找到答案。 这条线意味着什么?:
Error parsing text-format caffe.NetParameter: 1:7: Message type "caffe.NetParameter" has no field named "I0726".
真的很感谢你的帮助!
答案 0 :(得分:1)
这是因为你做错了。
您正在使用的文件:
Solver: /home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_solver.prototxt
Net: /home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_train_test.prototxt
Log output: /home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_train_test.prototxt
需要注意的是,Net文件和日志文件都是相同的,这意味着您要用日志数据替换Net文件。因此,当caffe求解器读取Net文件时,数据将被日志替换,从而导致错误。
这可以解决您的问题:
roishik@roishik-System-Product-Name:~/Desktop/caffe/caffe$ /home/roishik/Desktop/caffe/caffe/build/tools/caffe train --solver /home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_solver.prototxt 2>&1 | tee ./log.txt
但请确保您已使用正确的文件替换了覆盖的Net
文件。