首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >[深度学习][CenterFusion]关于centerfusion训练注意的要点

[深度学习][CenterFusion]关于centerfusion训练注意的要点

作者头像
云未归来
发布2025-07-19 15:12:45
发布2025-07-19 15:12:45
6500
代码可运行
举报
运行总次数:0
代码可运行

我参考博客https://blog.csdn.net/ssj925319/article/details/124294911写得非常详细,但是有些地方需要注意

第一个地方:

scikit-learn版本问题,官方要求是0.21.0版本,我安装0.21.3这个版本也是可以的

python版本问题:我使用的python3.8版本没有任何问题,所以不仅仅是python3.7支持如果你是python3.8也是没问题的

pytorch版本问题:我使用的torch==1.11.0+cu113 torchvision==0.12.0+cu113版本,训练时候会报错torchvision.model.utils找不到,只要改成

即将 from torchvision.models.utils import load_state_dict_from_url 改为 from torch.hub import load_state_dict_from_url

最后就是参数设置问题,注意gpu 0,1你有一个显卡把1去掉,batch-size不要太大不然容易爆显存。其他安装教程走就行了。

第二个地方:训练时候报错

TypeError: only integer tensors of a single element can be converted to an index

解决方法:

找到代码位置CenterFusion/src/lib/utils/pointcloud.py:

代码语言:javascript
代码运行次数:0
运行
复制
    bbox_int = torch.tensor([torch.floor(bbox[0]), 
                         torch.floor(bbox[1]), 
                         torch.ceil(bbox[2]), 
                         torch.ceil(bbox[3])], dtype=torch.int32)# format: xyxy

to

代码语言:javascript
代码运行次数:0
运行
复制
    bbox_int = torch.tensor([int(torch.floor(bbox[0])), 
                         int(torch.floor(bbox[1])), 
                         int(torch.ceil(bbox[2])), 
                         int(torch.ceil(bbox[3]))], dtype=torch.int32)# format: xyxy
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2023-04-28,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • TypeError: only integer tensors of a single element can be converted to an index
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档