在python中读取protobuf文本格式为.txt

6ojccjat  于 2021-09-08  发布在  Java
关注(0)|答案(0)|浏览(444)

我有一个.txt格式的文本文件,该文件的格式是protobuf text(prototxt)消息。

random_seed: 42
yolov3_config {
  big_anchor_shape: "[(376.5, 277.85), (1036.5, 213.23), (1096.5, 316.62)]"
  mid_anchor_shape: "[(106.5, 85.85), (237.75, 98.08), (433.5, 131.08)]"
  small_anchor_shape: "[(63.0, 13.38), (49.5, 42.69), (178.5, 30.0)]"
  matching_neutral_box_iou: 0.7
  arch: "resnet"
  nlayers: 18
  arch_conv_blocks: 2
  loss_loc_weight: 0.8
  loss_neg_obj_weights: 100.0
  loss_class_weights: 1.0
  freeze_bn: false
  #freeze_blocks: 0
  force_relu: false
}
training_config {
  batch_size_per_gpu: 2
  num_epochs: 1
  enable_qat: false
  checkpoint_interval: 1
  learning_rate {
  soft_start_annealing_schedule {
    min_learning_rate: 1e-6
    max_learning_rate: 1e-4
    soft_start: 0.1
    annealing: 0.5
    }
  }

如何使用python编辑此文件的字段或替换行?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题