社区
Java
帖子详情
IndexError: too many indices for tensor of dimension 1(10rmb)
鱼雨羽
2020-06-26 07:26:10
解决给10rmb,任何方式都行。python问题如下:
...全文
5066
3
打赏
收藏
IndexError: too many indices for tensor of dimension 1(10rmb)
解决给10rmb,任何方式都行。python问题如下:
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
maggiehhh
2020-08-03
打赏
举报
回复
masks[:,lengthsmax] 试试这样
鱼雨羽
2020-07-05
打赏
举报
回复
不对啊。我运行还是报错,麻烦你看一下,谢谢
sh_c_1314
2020-06-26
打赏
举报
回复
看报错masks是一维的,你好像使用了2维索引, 试试masks[:lengthsmax]
Pytorch笔记:诡异的索引操作 + too many
indices
for
tensor
of
dimension
1的一种解决方法
问题 too many
indices
for
tensor
of
dimension
1 具体的错误信息忘记截图,大概就是上面的意思,对应的错误代码如下 错误代码 # 下面代码是博主自己随意码的,具体要说一下怎么解决这种问题 import torch
index
= torch.
tensor
([20,10,25,39,5,12]) # 这些
index
的值,对应着point中的索引 point = torch.ones(2,40) # 然后用
index
中的数对point进行各点取值 result_x =
跑YOLO模型时出现
Index
Error
: too many
indices
for
tensor
of
dimension
3
上网查了原因,总之就是因为张量维数出错了,各位打开自己的ultralytics\utils\ops.py文件,找到我下面的那几行语句(我的在216行),其中第二行是跑YOLOV10才需要带上的,把他注释掉就行,当然你要是不放心,可以直接去GitHub随便找个V8项目,把他的ops.py拷过来也行,其实就是让他恢复初始状态就行,自己加的东西记得注释掉。最近做项目,在跑对比实验的时候出现了问题,自己本来是在跑YOLOV10的,然后需要跑V8的对比实验,想着两者相似就直接切换模型去跑了,然后就报错了233。
Index
Error
: too many
indices
for
tensor
of
dimension
2
Pytorch 错误:“
Index
Error
: too many
indices
for
tensor
of
dimension
0”|极客笔记 (deepinout.com)
Index
Error
: too many
indices
for
tensor
of
dimension
1
使用YoloV5和DeepSort做目标检测跟踪的时候,将视频流切换到了树莓派的网络摄像头,报以下错误 Traceback (most recent call last): File ".\demo_simple.py", line 77, in <module> demo.detect() File ".\demo_simple.py", line 58, in detect track_bboxes = tracker_l.update_tracker(frame
解决
Index
Error
: too many
indices
for
tensor
of
dimension
3
如果不小心搞错了
tensor
的维度,就会出现以下错误 >
Index
Error
: too many
indices
for
tensor
of
dimension
3 很有可能是你是一个三维的
tensor
,但是你在调用索引时使用了第四维的索引作切片, 这时应该检查是不是因为粗心而导致
tensor
的维度出错 例如: x = torch.randn(1, 2, 3) x[0, 0, 0, 0] 这样就会报
Index
Error
: too many
indices
for
tensor
of dimen
Java
51,407
社区成员
86,126
社区内容
发帖
与我相关
我的任务
Java
Java相关技术讨论
复制链接
扫一扫
分享
社区描述
Java相关技术讨论
java
spring boot
spring cloud
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章