Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
PR Category
Operator Mechanism
PR Types
Bug fixes
Description
interpolate的error_log.log 精度与配置报错汇总(共计 2079 条)
1.
cuda error 700(共 1356 条)原因:
int类型溢出,超过最大表示范围解决方案:将相关变量替换为
size_t类型,避免溢出。2.
CUDA error: invalid configuration argument(共 675 条)原因:Torch 报错
解决方案:将对应配置加入
tester/api_config/torch_error_skip.txt,参考:PR #4843.
The values for attribute 'shape' do not match(共 40 条)原因:输入
scale_h/scale_w使用float精度,而 Torch 使用double,导致乘法后误差放大并影响int强转后的结果,注意这里指的是函数初始化的过程paddle使用的是float,计算过程中强制转换成double只会放大误差!示例验证代码:
输出结果:
结论:使用
float会造成数值精度误差,通过double初始化可规避该问题。若改动范围过大,暂时处理方案为:4.
[accuracy error] paddle.nn.functional.interpolate(共 6 条)5.
[accuracy error] backward paddle.nn.functional.interpolate(共 2 条)问题一致,均为精度不足导致误差过大。
插值计算公式如下:
原因:
d1/d2,w1/w2,h1/h2精度不足;-解决方案:
float精度可控制误差;double后误差降至约 1.5,调整容忍度上限以放宽精度误差范围。Pcard-92269