mindnlp icon indicating copy to clipboard operation
mindnlp copied to clipboard

mindspore.ops.interpolate不支持mode="bicubic"模式下传入scale_factor参数

Open xuzihao2024 opened this issue 1 year ago • 0 comments

Describe the bug/ 问题描述 (Mandatory / 必填) 在DINOv2模型迁移时遇到该问题, PR链接:https://github.com/mindspore-lab/mindnlp/pull/1375, mindnlp/transformers/models/dinov2/modeling_dinov2.py:line83

mindspore.ops.interpolate不支持mode="bicubic"模式下传入scale_factor参数。 根据官方文档,若添加recompute_scale_factor=True可规避报错,但当scale_factor为浮点数时会产生精度误差。 官方文档:https://www.mindspore.cn/docs/zh-CN/master/note/api_mapping/pytorch_diff/interpolate.html

  • Hardware Environment(Ascend/GPU/CPU) / 硬件环境:

  • Software Environment / 软件环境 (Mandatory / 必填):

  • Excute Mode / 执行模式 (Mandatory / 必填)(PyNative/Graph):

To Reproduce / 重现步骤 (Mandatory / 必填)

Expected behavior / 预期结果 (Mandatory / 必填)

支持mode="bicubic"时传入浮点型scale_factor

Screenshots/ 日志 / 截图 (Mandatory / 必填)

image

Additional context / 备注 (Optional / 选填)

xuzihao2024 avatar Jul 05 '24 12:07 xuzihao2024