2016-07-26 95 views
0

我正在用我自己的數據,使用cifar10網絡層來培訓CNN。 但是,當我運行這個命令:使用cifar10求解器培訓CNN

[email protected]:~/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

您的train_val.prototxt或solver.prototxt是否包含字符串「I0726」? –

+0

請發佈'/ home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_train_test.prototxt''的頭幾行,以便我們看到caffe抱怨的語法錯誤。 – Shai

+0

哦,tnx注意到我:) – roishik

回答

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 

應當指出的是,無論是網絡文件和日誌文件是相同的,這意味着你與日誌數據代替淨文件。因此,在caffe求解器讀取Net文件時,數據被log取代,從而導致錯誤。

這應該解決您的問題:

[email protected]:~/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文件與正確的文件。

+0

哦,謝謝!你是對的! 我忘了寫.log而不是.prototxt – roishik