采用fluid.save和fluid.load接口保存和加载模型,,,恢复训练时报错
Created by: ahsdx
- 版本、环境信息:在aistudio上运行,paddle版本是1.6.2
请问下paddle恢复训练时,想换个优化器怎么做
😂 ?比如原来训练时采用的是Adam,用了warm_up策略,cosine_decay,然后我想换成Adam,piecewise_decay。保存模型时用的是fluid.save接口,恢复模型用的是fluid.load接口。 我直接将Adam优化器里面的学习率改成piecewise_decay后报错了。报错信息如下 /home/aistudio/work/tools W0314 12:20:32.815095 1315 device_context.cc:236] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 9.2, Runtime API Version: 9.0 W0314 12:20:32.819011 1315 device_context.cc:244] device: 0, cuDNN Version: 7.3. Traceback (most recent call last): File "recover_train.py", line 172, in train() File "recover_train.py", line 116, in train fluid.load(fluid.default_main_program(), '/home/aistudio/work/tools/efficientdet/efficientdet-d4-49',exe) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/io.py", line 1624, in load v.name, opt_file_name) AssertionError: Can not find [learning_rate] in model file [/home/aistudio/work/tools/efficientdet/efficientdet-d4-49.pdopt] 后面尝试将先前预训练的模型用save_persistables接口保存,然后在用load_persistables接口加载模型,也还是出错。然后听从paddle群管理员GT建议,将learning_rate_warmup文件删除掉也还是报错(说我learning_rate文件不存在)。请问这个怎么解决?