新版parse_config解析老版本配置时出现异常
Created by: hohdiy
具体是这样的:解析这个pool层时,新版本的parse_config,少了一个start = 0的字段的设置,这个字段的缺失会导致paddle train失败。
Layer(
name="pool",
type="pool",
inputs=Input("conv",
pool=Pool(pool_type="max-projection",
channels=16,
size_x=32,
start=0,
stride=8))
解析后的proto的debug string如下:(右侧是有问题的config,少了start = 0)
layers { | 39 layers {
41 name: "pool" | 40 name: "pool"
42 type: "pool" | 41 type: "pool"
43 size: 1936 | 42 size: 1936
44 active_type: "" | 43 active_type: ""
45 inputs { | 44 inputs {
46 input_layer_name: "conv" | 45 input_layer_name: "conv"
47 pool_conf { | 46 pool_conf {
48 pool_type: "max-projection" | 47 pool_type: "max-projection"
49 channels: 16 | 48 channels: 16
50 size_x: 32 | 49 size_x: 32
51 start: 0 | ----------------------------------------------------------------
52 stride: 8 | 50 stride: 8
53 output_x: 11 | 51 output_x: 11
54 img_size: 110 | 52 img_size: 110
55 padding: 0 | 53 padding: 0
56 size_y: 32 | 54 size_y: 32
57 stride_y: 8 | 55 stride_y: 8
58 output_y: 11 | 56 output_y: 11
59 img_size_y: 110 | 57 img_size_y: 110
----------------------------------------------------------------| 58 padding_y: 0
60 } | 59 }
61 } | 60 }