BEVFusion复现 (Ubuntu RTX3090)

2023-12-07 19:30

本文主要是介绍BEVFusion复现 (Ubuntu RTX3090),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

  • https://github.com/ADLab-AutoDrive/BEVFusion

1.环境安装

我的机器是RTX3090,CUDA11.1

  • 1.创建虚拟环境

    • conda create -n bevfusion python=3.8.3
  • 2.安装PyTorch 和 torchvision

    • pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
      • 因为RTX3090适配CUDA11以上的版本,更适合Pytorch1.8.0及以上,(BEVFusion要求CUDA 9.2,Pytorch=1.3.1,不能完全按照github上的),Pytorch1.9以上的又不适配要求的mmcv和mmdet版本,所以这么完全是按照RTX3090安装环境
  • 3.安装MMCV

    • 方法1:
      • 下载地址:https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
        • cuda版本不一样,把地址中cu111改了就行
          下载mmcv_full-1.4.0-cp38-cp38-manylinux1_x86_64.whl
      • pip install mmcv_full-1.4.0-cp38-cp38-manylinux1_x86_64.whl
    • 方法2:
      • pip install -U openmim -i https://pypi.tuna.tsinghua.edu.cn/simple
      • mim install mmcv-full==1.6.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
        我是方法1成功的
  • 4.安装mmdet
    在代码中mmdetection-2.11.0文件中编译安装,不需要去下载了

    • cd mmdetection-2.11.0
    • pip install -r requirements/build.txt
    • pip install -v -e .
      如果遇到
error: legacy-install-failure× Encountered error while trying to install package.
╰─> mmpycocotools

说明安装pip install -r requirements/build.txt时安装的Cython版本太高了,降低版本即可:pip install Cython==0.29.36,然后再次pip install -v -e .

  • 5.安装MMDetection3D
    先回到BEVFusion主目录

    • cd ..
    • git clone https://github.com/open-mmlab/mmdetection3d.git
    • cd mmdetection3d
    • pip install -v -e .
  • 6.编译BEVFusion环境

    • cd ..
    • python setup.py develop
  • bug1:

Installed /home/ywj/work/anaconda3/envs/bevfusion/lib/python3.8/site-packages/networkx-2.2-py3.8.egg
error: networkx 2.2 is installed but networkx>=2.8 is required by {'scikit-image'}

pip install scikit-image==0.19.3

  • bug2:
Installed /home/ywj/work/anaconda3/envs/bevfusion/lib/python3.8/site-packages/llvmlite-0.31.0-py3.8-linux-x86_64.egg
error: numpy 1.19.5 is installed but numpy>=1.20.3; python_version < "3.10" is required by {'pandas'}

pip install pandas==1.4.4

  • bug3:
RuntimeError: radix_sort: failed on 1st step: cudaErrorInvalidDevice: invalid device ordinal(BEVFusion)

原因:torch版本不对
解决办法:显卡是3090,最后安装的是python==3.7,pytorch=1.9.0,cuda=11.1

  • 其他安装包不兼容的问题:
    直接按照提示安装低版本的就行

2.数据准备

  • nuScenes:
    • python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes

可能出现bug :说明MMCV版本没装对,装的是cuda10.1的版本,重新安装

ImportError: libcudart.so.10.1: cannot open shared object file: No such file or directory

3. 训练

3.1. Unimage

  1. 配置
  • 数据下载:https://www.nuscenes.org/nuimages#download(建议用迅雷)
  • 获取标签代码:https://github.com/open-mmlab/mmdetection3d/tree/1.0/configs/nuimages
    • 在mmdetection3d目录下执行
      • python -u tools/dataset_converters/nuimage_converter.py --data-root /home/ywj/work/data/unimages --version v1.0-train v1.0-val v1.0-mini --out-dir /home/ywj/work/data/unimages/annotations/ --nproc 16
  • 权重下载:
    • mask_rcnn_cbv2_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.pth:https://github.com/VDIGPKU/CBNetV2/blob/main/model_zoo.md
    • swin_tiny_patch4_window7_224_22k.pth:
      https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_tiny_patch4_window7_224.pth
  1. 标签解读
  • json解释:https://github.com/nutonomy/nuscenes-devkit/blob/master/docs/schema_nuimages.md
    • attribute.json
      • 属性是实例的属性,可以在类别保持不变的情况下更改。例如:停放/停止/移动的车辆,以及自行车是否有人骑车。nuImages 中的属性是 nuScenes 中属性的超集。
attribute {"token":                   <str> -- Unique record identifier."name":                    <str> -- Attribute name."description":             <str> -- Attribute description.
}
  • calibrated_sensor.json
    - 定义在特定车辆上校准的特定摄像机。所有外部参数都是相对于自我车身框架给出的。与 nuScenes 相反,所有相机图像都会扭曲且未经校正。
calibrated_sensor {"token":                   <str> -- Unique record identifier."sensor_token":            <str> -- Foreign key pointing to the sensor type."translation":             <float> [3] -- Coordinate system origin in meters: x, y, z."rotation":                <float> [4] -- Coordinate system orientation as quaternion: w, x, y, z."camera_intrinsic":        <float> [3, 3] -- Intrinsic camera calibration. Empty for sensors that are not cameras."camera_distortion":       <float> [5 or 6] -- Camera calibration parameters [k1, k2, p1, p2, k3, k4]. We use the 5 parameter camera convention of the CalTech camera calibration toolbox, that is also used in OpenCV. Only for fish-eye lenses in CAM_BACK do we use the 6th parameter (k4).
}
  • 对象类别的分类(例如车辆、人类)。子类别由句点界定(例如human.pedestrian.adult)。nuImages 中的
类别与 nuScenes 中的类别相同(不包含 litarseg),再加上flat.driveable_surface.
category {"token":                   <str> -- Unique record identifier."name":                    <str> -- Category name. Subcategories indicated by period."description":             <str> -- Category description.
}
  1. 实验结果
  • 训练速度:4卡3090 约4h/1epoch(samples_per_gpu=2),一共需要3d/36epoch

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

  • epoch36 paper结果:
    在这里插入图片描述

3.2. bevf_pp_cam

  • 训练速度:4卡3090 约4h/1epoch(samples_per_gpu=1)

在这里插入图片描述

  • loss下降曲线很差,估计有batch太小的原因

这篇关于BEVFusion复现 (Ubuntu RTX3090)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/467080

相关文章

Ubuntu设置程序开机自启动的操作步骤

《Ubuntu设置程序开机自启动的操作步骤》在部署程序到边缘端时,我们总希望可以通电即启动我们写好的程序,本篇博客用以记录如何在ubuntu开机执行某条命令或者某个可执行程序,需要的朋友可以参考下... 目录1、概述2、图形界面设置3、设置为Systemd服务1、概述测试环境:Ubuntu22.04 带图

Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题

《Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题》:本文主要介绍Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未... 目录一、前言二、系统架构检测三、卸载旧版 Go四、下载并安装正确版本五、配置环境变量六、验证安装七、常见

ubuntu如何部署Dify以及安装Docker? Dify安装部署指南

《ubuntu如何部署Dify以及安装Docker?Dify安装部署指南》Dify是一个开源的大模型应用开发平台,允许用户快速构建和部署基于大语言模型的应用,ubuntu如何部署Dify呢?详细请... Dify是个不错的开源LLM应用开发平台,提供从 Agent 构建到 AI workflow 编排、RA

ubuntu系统使用官方操作命令升级Dify指南

《ubuntu系统使用官方操作命令升级Dify指南》Dify支持自动化执行、日志记录和结果管理,适用于数据处理、模型训练和部署等场景,今天我们就来看看ubuntu系统中使用官方操作命令升级Dify的方... Dify 是一个基于 docker 的工作流管理工具,旨在简化机器学习和数据科学领域的多步骤工作流。

如何在Ubuntu上安装NVIDIA显卡驱动? Ubuntu安装英伟达显卡驱动教程

《如何在Ubuntu上安装NVIDIA显卡驱动?Ubuntu安装英伟达显卡驱动教程》Windows系统不同,Linux系统通常不会自动安装专有显卡驱动,今天我们就来看看Ubuntu系统安装英伟达显卡... 对于使用NVIDIA显卡的Ubuntu用户来说,正确安装显卡驱动是获得最佳图形性能的关键。与Windo

双系统电脑中把Ubuntu装进外接移动固态硬盘的全过程

《双系统电脑中把Ubuntu装进外接移动固态硬盘的全过程》:本文主要介绍如何在Windows11系统中使用VMware17创建虚拟机,并在虚拟机中安装Ubuntu22.04桌面版或Ubunt... 目录一、首先win11中安装vmware17二、磁盘分区三、保存四、使用虚拟机进行系统安装五、遇见的错误和解决

CentOS和Ubuntu系统使用shell脚本创建用户和设置密码

《CentOS和Ubuntu系统使用shell脚本创建用户和设置密码》在Linux系统中,你可以使用useradd命令来创建新用户,使用echo和chpasswd命令来设置密码,本文写了一个shell... 在linux系统中,你可以使用useradd命令来创建新用户,使用echo和chpasswd命令来设

Ubuntu中远程连接Mysql数据库的详细图文教程

《Ubuntu中远程连接Mysql数据库的详细图文教程》Ubuntu是一个以桌面应用为主的Linux发行版操作系统,这篇文章主要为大家详细介绍了Ubuntu中远程连接Mysql数据库的详细图文教程,有... 目录1、版本2、检查有没有mysql2.1 查询是否安装了Mysql包2.2 查看Mysql版本2.

新特性抢先看! Ubuntu 25.04 Beta 发布:Linux 6.14 内核

《新特性抢先看!Ubuntu25.04Beta发布:Linux6.14内核》Canonical公司近日发布了Ubuntu25.04Beta版,这一版本被赋予了一个活泼的代号——“Plu... Canonical 昨日(3 月 27 日)放出了 Beta 版 Ubuntu 25.04 系统镜像,代号“Pluc

Ubuntu中Nginx虚拟主机设置的项目实践

《Ubuntu中Nginx虚拟主机设置的项目实践》通过配置虚拟主机,可以在同一台服务器上运行多个独立的网站,本文主要介绍了Ubuntu中Nginx虚拟主机设置的项目实践,具有一定的参考价值,感兴趣的可... 目录简介安装 Nginx创建虚拟主机1. 创建网站目录2. 创建默认索引文件3. 配置 Nginx4