训练阶段按原代码跑的,没有改动:save-steps为1000
在测试阶段,运行predict.py的参数--init_checkpoint ${OUTPUT_PATH}/50 \报错显示找不到此文件
而将此参数改为--init_checkpoint ${OUTPUT_PATH}/210000 \后又产生如下报错:
Traceback (most recent call last):
File "predict.py", line 101, in
main(args)
File "predict.py", line 72, in main
init_pretraining_params(exe, args.init_checkpoint, main_program)
File "/home/wangkexin/ACL2019-DuConv/retrieval_paddle/source/utils/utils.py", line 54, in init_pretraining_params
predicate=existed_params)
File "/home/wangkexin/anaconda3/envs/baidu/lib/python2.7/site-packages/paddle/fluid/io.py", line 682, in load_vars
filename=filename)
File "/home/wangkexin/anaconda3/envs/baidu/lib/python2.7/site-packages/paddle/fluid/io.py", line 741, in load_vars
format(orig_shape, each_var.name, new_shape))
RuntimeError: Shape not matching: the Program requires a parameter with a shape of ((14373L, 256L)), while the loaded parameter (namely [ context_word_embedding ]) has a shape of ((13145, 256)).
应该就是shape的规模不对了
请校正一下
谢谢,已解决
请问楼主怎么解决的,小白也遇到了类似的我问题
RuntimeError: Shape not matching: the Program requires a parameter with a shape of ((21, 512, 1, 1)), while the loaded parameter (namely [ conv2d_61.w_0 ]) has a shape of ((75, 512, 1, 1)).
麻烦 不吝赐教