2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

 / 详情

排序时出现奇怪的报错 `mindspore-assistant`

REJECTED
Question
创建于  
2022-09-23 11:14

评论 (4)

linqile 创建了Question

Please assign maintainer to check this issue.
请为此issue分配处理人。
@fangwenyi @chengxiaoli

Please add labels (comp or sig), also you can visit https://gitee.com/mindspore/community/blob/master/sigs/dx/docs/labels.md to find more.
为了让代码尽快被审核,请您为Pull Request打上 组件(comp)或兴趣组(sig) 标签,打上标签的PR可直接推送给责任人进行审核。
更多的标签可以查看https://gitee.com/mindspore/community/blob/master/sigs/dx/docs/labels.md
以组件相关代码提交为例,如果你提交的是data组件代码,你可以这样评论:
//comp/data
当然你也可以邀请data SIG组来审核代码,可以这样写:
//sig/data
另外你还可以给这个PR标记类型,例如是bugfix或者是特性需求:
//kind/bug or //kind/feature
恭喜你,你已经学会了使用命令来打标签,接下来就在下面的评论里打上标签吧!

linqile 修改了描述

**环境:mindapore-gpu1.8.1 cuda10.1 **

代码:
mask=mask.astype(ms.bool_).view(-1,1)
MaskedSelect=ms.ops.MaskedSelect()
x_b = MaskedSelect(x_b, mask).view((-1,x_b.shape[1]))
geometry_b=MaskedSelect(geometry_b,mask).view((-1,geometry_b.shape[1]))

Sort tensors so that those within the same voxel are consecutives.

ranks = geometry_b[:, 0] * int(self.bev_dimension[1]* self.bev_dimension[2])
+ geometry_b[:, 1] * int(self.bev_dimension[2])
+ geometry_b[:, 2]

ranks_indices = ops.Sort(axis=-1,descending=False)(ranks.astype(ms.float32)) #此处报错
x_b, geometry_b, ranks = x_b[ranks_indices], geometry_b[ranks_indices], ranks[ranks_indices]

报错信息为:

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/nn/cell.py", line 607, in call

raise err 

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/nn/cell.py", line 603, in call

output = self._run_construct(cast_inputs, kwargs) 

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/nn/cell.py", line 442, in _run_construct

output = self.construct(*cast_inputs, **kwargs) 

File "/raid/yxw/MFL/mfl/trainAndvisualise/trainer_mindspore.py", line 115, in construct

output = self.model(image, intrinsics, extrinsics) 

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/nn/cell.py", line 607, in call

raise err 

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/nn/cell.py", line 603, in call

output = self._run_construct(cast_inputs, kwargs) 

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/nn/cell.py", line 442, in _run_construct

output = self.construct(*cast_inputs, **kwargs) 

File "/raid/yxw/MFL/mfl/models/mfl.py", line 101, in construct

x = self.calculate_birds_eye_view_features(image, intrinsics, extrinsics) 

File "/raid/yxw/MFL/mfl/models/mfl.py", line 229, in calculate_birds_eye_view_features

x = self.projection_to_birds_eye_view(x, geometry) 

File "/raid/yxw/MFL/mfl/models/mfl.py", line 200, in projection_to_birds_eye_view

ranks_indices = ops.Sort(axis=-1,descending=False)(ranks.astype(ms.float32).view(-1)) 

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/ops/primitive.py", line 294, in call

return _run_op(self, self.name, args) 

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/common/api.py", line 98, in wrapper

results = fn(*arg, **kwargs) 

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/ops/primitive.py", line 748, in _run_op

output = real_run_op(obj, op_name, args) 

File "/raid/anaconda3/envs/fiery/lib/python3.7/site-packages/mindspore/ops/operations/array_ops.py", line 771, in infer

raise ValueError(f"For '{self.name}', there can be at most one '-1' in 'input_shape', " 

ValueError: For 'Reshape', there can be at most one '-1' in 'input_shape', but got [-1, -1].

ranks的shape为(444694)

且在debug模式下,当以上报错已发生后,再次单独执行报错语句,竟不会再次报错,顺利输出,求教怎么回事
论坛求助的链接:https://bbs.huaweicloud.com/forum/thread-0213992110650280042-1-1.html

fangwenyi 关联项目设置为MindSpore Issue Assistant
fangwenyi 任务状态TODO 修改为ACCEPTED
fangwenyi 添加了
 
mindspore-assistant
标签
fangwenyi 负责人设置为fangwenyi
fangwenyi 任务状态ACCEPTED 修改为REJECTED

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore

搜索帮助

344bd9b3 5694891 D2dac590 5694891