0

I have a solver file as shown below.

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"

I tried to read the file using the code below as

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;
}

I can't parse in Windows but it works in Linux. What could be the issue?

EDIT:

What could be the issue? I can read this prototxt file using the same code.

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
8-Bit Borges
  • 9,643
  • 29
  • 101
  • 198
batuman
  • 7,066
  • 26
  • 107
  • 229
  • what error exactly are you getting? have you compiled `caffe.proto` for windows? can you read other prototxt files on windows? – Shai Apr 12 '18 at 18:24

1 Answers1

0

if you can parse it on Linux, but you can not on windows, I would say that your problem is an encoding problem.

https://superuser.com/questions/294219/what-are-the-differences-between-linux-and-windows-txt-files-unicode-encoding

If you open your file with Notepad++ for example, you should be able to see these special characters.

Reading at that other thread, sounds like TextFormat is expecting only UTF-8 encoded characters: What does the protobuf text format look like?

How do you build your prototxt?

Luc
  • 1,393
  • 1
  • 6
  • 14