使用mindspore.ops.interpolate报错ValueError:For "scale_factor" option cannot currentiy be set with the mode = bilinear = 4D
收藏回复举报
使用mindspore.ops.interpolate报错ValueError:For "scale_factor" option cannot currentiy be set with the mode = bilinear = 4D
发表于2023-07-29 16:31:18
0 查看

1 系统环境

硬件环境(Ascend/GPU/CPU): Ascend/GPU/CPU

MindSpore版本: mindspore=2.0

执行模式(PyNative/ Graph):不限

Python版本: Python=3.7

操作系统平台: 不限

2 报错信息

2.1 问题描述

img是三维的,(C,H,W),unsqueeze转换成4维后,想用bilinear模式的interpolate,但是却报错说不能设置 scale_factor

2.2 报错信息

ValueError:For "interpolate" , "scale_factor" option cannot currentiy be set with the mode = bilinear and dim = 4D

2.3 脚本代码(代码格式,可上传附件)

img = torch.nn.functional.upsample_bilinear(img.unsqueeze(0), scale_factor=scale).squeeze(0)

3 根因分析

******此处由用户补充详细的定位过程******

4 解决方案

******此处由用户填写******

包含文字方案和最终脚本代码

请将正确的脚本打包并上传附件

00.PNG

我要发帖子