新版parse_config解析老版本配置时出现异常
具体是这样的:解析这个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 }
@hohdiy 贴下你新配置写法中相关的部分。
@hohdiy 新版新版本的parse_config删掉start这个参数,所以你在配置中去掉这个参数就可以了~
@hohdiy 这个问题之前有人遇到过,去掉start参数是没有问题的,这个PR https://github.com/PaddlePaddle/Paddle/commit/0f6e8138b2e679339b2a57e830879d9ee7d8f4bf 也针对老的配置做了一些修改。 如果没有问题,还麻烦回复下。
@qingqing01 我明白你的意思了,就是说start = 0 在新的paddle train 中没有用到,所以被删除了。 但是目前我的问题在于,用新版本parse_config要能跑在老版本的paddle train中,因此这个start = 0 是需要的。 如果你们不方便支持,我这边另想办法,多谢了。
补充一点: 老版本的config中: start 是required,所以不能缺失 59 // Tell the net where in the input image to start the pooling. 60 required uint32 start = 4;
看到你给我的ref中,start 已经变成optional了。
@hohdiy 为什么不能升级Paddle到最新的版本呢?
如果有什么升级上的问题,可以开新的issue讨论。我们目前只会维护master分支的各个release和develop分支的最新版本。
@reyoung 唯一的原因是没有rpc读数据的支持。
RPC读数据一直不在Paddle的主线里。
另外,如果想要实现RPC读数据的话,可以直接用现有的PyDataProvider,工作量不会很大的。
@reyong 好的,我也在考虑,这里面兼容性的坑可能很大,虽然暂时解决了,后续也很难保证。我这边尝试使用PyDataProvider+新版本的paddle train 来实现。