0

I'm trying to train a CNN with my own data, using cifar10 network layers. but, when I'm running this command:

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

I get this error message:

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)

I searched all over google and didn't find an answer. What does this line means?:

 Error parsing text-format caffe.NetParameter: 1:7: Message type "caffe.NetParameter" has no field named "I0726".

Really appreciate your help!

roishik
  • 515
  • 2
  • 9
  • 19
  • does your train_val.prototxt or solver.prototxt contain the string "I0726"? – Autonomous Jul 26 '16 at 23:08
  • please post the first few lines of `'/home/roishik/Desktop/Thesis/Code/cafe_cnn/first/caffe_models/cifar_10_fast/cifar10_quick_train_test.prototxt'` so we can see the syntax error that caffe is complaining about. – Shai Jul 27 '16 at 05:55
  • Oh, tnx for noticing me :) – roishik Jul 27 '16 at 16:42

1 Answers1

1

It is because you are doing it wrong.

The files that you are using:

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

It is to be noted that both the Net file and log file are the same, which means you are replacing the Net file with the log data. Thus, by the time caffe solver reads through the Net file, the data gets replaced by log and hence the error.

This should solve your issue:

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

But make sure that you have replaced the overwritten Net file with the correct file.

Anoop K. Prabhu
  • 5,417
  • 2
  • 26
  • 43