PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.28k stars 5.61k forks source link

静态图导出缺失文件 #69631

Open yimuu opened 15 hours ago

yimuu commented 15 hours ago

bug描述 Describe the Bug

静态图导出缺失.pdmodel文件 paddle版本:3.0.0.dev20241120

import paddle
import paddle.nn as nn

IMAGE_SIZE = 784 
CLASS_NUM = 10

class LinearNet(nn.Layer):
    def __init__(self):
        super().__init__()
        self._linear = nn.Linear(IMAGE_SIZE, CLASS_NUM)
    # 规范写法,forward 中仅实现预测功能
    @paddle.jit.to_static
    def forward(self, x): 
        return self._linear(x)

l = LinearNet()
paddle.jit.save(l, ".", [paddle.static.InputSpec(shape=[None, 784], dtype="float32", name="penalty_score")])

生成的文件只有pdiparams

其他补充信息 Additional Supplementary Information

No response