Open justld opened 2 years ago
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
您好,比赛快结束了,请问这个问题有进展吗?
同学你好,有些信息需要进一步了解一下。请问静态图的执行,是使用 executor+load_inference_model 接口执行的吗?还是使用推理的 predictor 加载执行的呢?
你好,我使用的是paddleseg使用的推理方法,该方法使用paddle.inference的predictor进行推理,推理代码链接:https://github.com/justld/PSANet_paddle/blob/main/deploy/python/infer.py
收到~有进一步的进展我再回复您
您好,可以详细说明下该自定义算子的功能吗?输入及输出。最好可以举一个具体的例子。方便我们可以使用单个 op 复现动态图、静态图结果不一致问题。
您好,这里有完整的介绍,可复现的静态图预测不一致问题:https://aistudio.baidu.com/aistudio/projectdetail/3851842?contributionType=1
bug描述 Describe the Bug
自定义外部算子静态图推理异常:自定义外部算子动态图预测正常,导出静态图后推理异常
环境:aistudio gpu 至尊 paddlepaddle==2.2.2
自定义算子组网:https://github.com/justld/PSANet_paddle/blob/2f709cc39aa5519b37c4e914708dbf37cea79d8e/paddleseg/models/psanet.py#L189
测试结果:自定义算子导出静态图后预测异常。
测试方法: 1、使用nn.Conv2D替代自定义算子,动态图预测结果和静态图推理结果一致; 使用Conv2D替换自定义算子(其他无任何改变,T添加的Conv2D参数默认初始化),动态图预测结果: 动态图模型导出为静态图,推理结果和动态图一致:
2、使用自定义算子,动态图预测结果是对的,静态图推理错误(与动态图不一致)。 动态图预测结果: 导出静态图后推理结果(与动态图不一致):
其他补充信息 Additional Supplementary Information
问题描述:自定义外部算子psamask动态图预测正常,导出静态图后推理异常(与动态图预测结果不一致)
环境:aistudio gpu 至尊 paddlepaddle==2.2.2
自定义算子组网:https://github.com/justld/PSANet_paddle/blob/2f709cc39aa5519b37c4e914708dbf37cea79d8e/paddleseg/models/psanet.py#L189
测试结果:自定义算子导出静态图后预测异常。
测试方法: 1、使用nn.Conv2D替代自定义算子,动态图预测结果和静态图推理结果一致; 使用Conv2D替换自定义算子(其他无任何改变,T添加的Conv2D参数默认初始化),动态图预测结果: 动态图模型导出为静态图,推理结果和动态图一致:
2、使用自定义算子,动态图预测结果是对的,静态图推理错误(与动态图不一致)。 动态图预测结果: 导出静态图后推理结果(与动态图不一致):
外部算子C++代码(psamask.cc, psamask.cu), psamask.cc代码如下:
psamask.cu代码如下: