Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

functional.py文件的interpolate()函数报错 #1571

Open
liuyifan123123 opened this issue Aug 16, 2024 · 2 comments
Open

functional.py文件的interpolate()函数报错 #1571

liuyifan123123 opened this issue Aug 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@liuyifan123123
Copy link

Describe the bug/ 问题描述 (Mandatory / 必填)
image
ut测试出现interpolate的scale_factor变量类型问题
TypeError: For 'interpolate', the 'scale_factor' must be float, but got 'int'

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

  • GPU/CPU

  • Software Environment / 软件环境 (Mandatory / 必填):
    -- MindSpore version :
    Mindspore2.2.14
    -- Python version :
    python3.9.19
    -- OS platform and distribution (e.g., Linux Ubuntu 16.04):
    window/Linuxx86_64
    -- GCC/Compiler version (if compiled from source):
    gcc-9

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

Please delete the mode not involved / 请删除不涉及的模式:
/mode pynative
/mode graph

To Reproduce / 重现步骤 (Mandatory / 必填)
pytest test_model_depth_anything.py

Expected behavior / 预期结果 (Mandatory / 必填)
A clear and concise description of what you expected to happen.

Screenshots/ 日志 / 截图 (Mandatory / 必填)
实例代码:
from mindnlp.core.nn import functional as F
import mindspore
tensor_variable = mindspore.tensor([[1, 2], [3, 4]], dtype=mindspore.float32)
size = None
modifier = {"scale_factor": 2} if size is None else {"size": size}
Hidden = F.interpolate(tensor_variable, **modifier, mode='bilinear', align_corners=True)
if "name" == "main":
print(type(tensor_variable))
print(Hidden)

复刻报错:
image

Additional context / 备注 (Optional / 选填)
Add any other context about the problem here.

@liuyifan123123 liuyifan123123 added the bug Something isn't working label Aug 16, 2024
@lvyufeng
Copy link
Collaborator

torch可以用?

@lvyufeng
Copy link
Collaborator

目前看起来不太好改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants