动态图训练的模型保存模型报错
收藏
保存模型 之前只保留了参数 要部署的时候需要保存模型
使用 paddle.save(net, model_prefix + ".pdmodel")
显示
ValueError: paddle do not support saving `paddle.nn.Layer` object.
使用 paddle.jit.save(net, model_prefix + ".pdmodel")
显示
Please specific `input_spec` in `@paddle.jit.to_static` or feed input tensor to call the decorated function at once.
0
收藏
请登录后评论
可以参考这篇文档中的方式二:https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/04_dygraph_to_static/basic_usage_cn.html#to-static
Please specific `input_spec` in `@paddle.jit.to_static` or feed input tensor to call the decorated function at once.
静态图需要保存输入的形状
paddle.save
动态图可以只保存模型权重