Docker-mmdetection3d

2023-11-04 22:30
文章标签 docker mmdetection3d

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

Docker-mmdetection3d

ubuntu18.04 3090Ti

文章目录

  • Docker-mmdetection3d
    • docker安装
    • 部署cuda
    • 报错
    • 安装mmdetection3d
    • 测试
    • 使用现成的镜像

docker安装

https://blog.csdn.net/b1134977524/article/details/120442417
常用命令:

  • https://blog.csdn.net/u013378306/article/details/86668313
  • https://blog.csdn.net/awodwde/article/details/122047721(wsl)

部署cuda

https://blog.csdn.net/weixin_50008473/article/details/119464898


报错

  • 用docker命令时报错,提示:Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
  • 出现问题原因:
    可能是上一次没有正常退出docker,所以docker没有正常启动,在相应的/var/run/路径下找不到docker进程。
    [root@node02 ~]# systemctl stop docker.socket
    [root@node02 ~]# sudo systemctl restart docker
    [root@node02 ~]# docker ps
    CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
    
  • 参考:https://blog.csdn.net/weixin_42449832/article/details/114994451

安装mmdetection3d

参考:https://blog.csdn.net/weixin_41010198/article/details/116133545
可以按需修改docker/下的DockerFile

docker build -t mmdetection3d docker/

生成or启动mmdetection3容器

sudo docker run --gpus all --shm-size=8g -it -v /home/wtw/workspace/:/mmdetection3d/data mmdetection3d

/home/wtw/workspace/映射一个本地的路径到容器中,用于存放数据,这样不会导致你容器删除的时候出现数据丢失!!!

暂时安装镜像没有报错,但是测试demo时,报错mmcv1.3.8冲突

修改mmcv,从https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html查询版本

pip uninstall mmcv-full
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/mmcv_full-1.3.14-cp37-cp37m-manylinux1_x86_64.whl

如果有问题,参考https://blog.csdn.net/weixin_36670529/article/details/116664344 不同方法


安装报错


ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.imageio 2.10.3 requires pillow>=8.3.2, but you'll have pillow 8.1.1 which is incompatible.

没有A4B469963BF863CC key,添加

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A4B469963BF863CC

Certificate verification failed
将https改成http

Dockerfile中修改pip镜像

RUN pip3 config set global.index-url http://mirrors.aliyun.com/pypi/simple
RUN pip3 config set install.trusted-host mirrors.aliyun.com

还是存在pillow问题,不过容器生成了
手动将pillow升级后,保存新镜像
sudo docker ps
sudo docker commit relaxed_gauss mmdet3d_modify
移除多余镜像

测试

python demo/pcd_demo.py demo/data/kitti/kitti_000008.bin configs/second/hv_second_secfpn_6x8_80e_kitti-3d-car.py data/testmm3d/hv_second_secfpn_6x8_80e_kitti-3d-car_20200620_230238-393f000c.pth --out-dir data/output_result/
  • 显示测试结果
    https://mmdetection3d.readthedocs.io/en/latest/useful_tools.html#visualization

修改的Dockerfile

ARG PYTORCH="1.8.0"
ARG CUDA="11.1"
ARG CUDNN="8"FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-develENV TORCH_CUDA_ARCH_LIST="5.0 7.0 8.0 8.6+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak  \&& echo  "# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释\ndeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse\n# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse\ndeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse\n# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse\ndeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse\n# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse\ndeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse\n# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse" >  /etc/apt/sources.list && cat  /etc/apt/sources.list\&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A4B469963BF863CCRUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 \&& apt-get clean \&& rm -rf /var/lib/apt/lists/*
# set pip channel
RUN pip3 config set global.index-url http://mirrors.aliyun.com/pypi/simple 
RUN pip3 config set install.trusted-host mirrors.aliyun.com 
# Install MMCV, MMDetection and MMSegmentation
RUN pip install openmim
RUN mim install mmdet
RUN pip install mmsegmentation
#RUN pip install mmcv-full==1.3.16 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
#RUN pip install mmdet==2.17.0
#RUN pip install mmsegmentation==0.18.0# Install MMDetection3D
RUN conda clean --all
RUN git clone https://github.com/open-mmlab/mmdetection3d.git /mmdetection3d
WORKDIR /mmdetection3d
ENV FORCE_CUDA="1"
RUN pip install -r requirements/build.txt
#RUN pip uninstall mmcv-ful -y && pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/mmcv_full-1.6.0-cp38-cp38-manylinux1_x86_64.whl
RUN pip uninstall mmcv-ful -y && pip install mmcv-full==1.6.0   pillow==8.3.2   ipython==7.23.1   traitlets==5.2.2
RUN pip install --no-cache-dir -e .

cuda支持的算力要高于实际的显卡算力——软件支持算力高于硬件
修改setup.py文件里的TORCH_CUDA_ARCH_LIST,将这个值改成你当前使用的GPU对应算力,可以使cuda(软件算力)降到硬件范围


使用现成的镜像

 docker search mmdetection

在这里插入图片描述

挑选了这个朋友的镜像,pulling…

docker pull  hquan7395/mmdetection3d-lab

run起来,/home/{共享路径}/(本地):/mmdetection3d/data(docker容器)

sudo docker run --gpus all --shm-size=8g -it -v /home/{共享路径}/:/mmdetection3d/data hquan7395/mmdetection3d-lab

测试mm3d(需要下载模型权重文件)

python demo/pcd_demo.py demo/data/kitti_000008.bin configs/second/hv_second_secfpn_6x8_80e_kitti-3d-car.py checkpoints/hv_second_secfpn_6x8_80e_kitti-3d-car_20200620_230238-393f000c.pth

通过共享路径将结果文件夹传出来
show

在这里插入图片描述
ps:这是在自己的1050ti笔记本上测试的

这篇关于Docker-mmdetection3d的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



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

相关文章

如何用Docker运行Django项目

本章教程,介绍如何用Docker创建一个Django,并运行能够访问。 一、拉取镜像 这里我们使用python3.11版本的docker镜像 docker pull python:3.11 二、运行容器 这里我们将容器内部的8080端口,映射到宿主机的80端口上。 docker run -itd --name python311 -p

禅道Docker安装包发布

禅道Docker安装包发布 大家好, 禅道Docker安装包发布。 一、下载地址 禅道开源版:   /dl/zentao/docker/docker_zentao.zip  备用下载地址:https://download.csdn.net/download/u013490585/16271485 数据库用户名: root,默认密码: 123456。运行时,可以设置 MYSQL_ROOT_P

828华为云征文|华为云Flexus X实例docker部署rancher并构建k8s集群

828华为云征文|华为云Flexus X实例docker部署rancher并构建k8s集群 华为云最近正在举办828 B2B企业节,Flexus X实例的促销力度非常大,特别适合那些对算力性能有高要求的小伙伴。如果你有自建MySQL、Redis、Nginx等服务的需求,一定不要错过这个机会。赶紧去看看吧! 什么是华为云Flexus X实例 华为云Flexus X实例云服务是新一代开箱即用、体

docker-compose安装和简单使用

本文介绍docker-compose的安装和使用 新版docker已经默认安装了docker-compose 可以使用docker-compose -v 查看docker-compose版本 如果没有的话可以使用以下命令直接安装 sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-c

01 Docker概念和部署

目录 1.1 Docker 概述 1.1.1 Docker 的优势 1.1.2 镜像 1.1.3 容器 1.1.4 仓库 1.2 安装 Docker 1.2.1 配置和安装依赖环境 1.3镜像操作 1.3.1 搜索镜像 1.3.2 获取镜像 1.3.3 查看镜像 1.3.4 给镜像重命名 1.3.5 存储,载入镜像和删除镜像 1.4 Doecker容器操作 1.4

Windows与linux中docker的安装与使用

windos中安装使用docker 下载Docker_Desktop 安装包进入docker官网下载Docker_Desktop: https://www.docker.com/ 启用wsl 我们搜索“启用或关闭Windows功能”,打开后勾选适用于Linux的Windows 子系统 Docker_Desktop设置 出现Docker Engine stopped的解决

docker学习系列(四)制作基础的base项目镜像--jdk+tomcat

前面已经完成了docker的安装以及使用,现在我们要将自己的javaweb项目与docker结合 1.1准备jdk+tomcat软件 ​​我下载了apache-tomcat-7.0.68.tar.gz和jdk-7u79-linux-x64.tar.gz,存储于Linux机器的本地目录/usr/ect/wt/下(利用xshell上传)。利用linux命令 tar -zxvf apache-tom

docker学习系列(三)docker使用

紧接着之前的博客,这一篇主要写如何使用docker 系列1:docker简介:http://blog.csdn.net/u013469562/article/details/72864323 系列2: docker安装:http://blog.csdn.net/u013469562/article/details/72865167 一、docker镜像的获取 1.1搜索可用镜像

docker学习系列(二)docker安装

接着之前的博客http://blog.csdn.net/u013469562/article/details/72864323,今天写一下docker的安装和使用 1.1docker的安装前置需求 首先docker目前的版本已经到了v17.03 本文采用centos6.6版本安装docker,其他操作系统可以参考其他博客,首先docker对于centos的需求如下 C

docker学习系列(一)初识docker

在第一版本上线之后公司,我们决定将之前使用的开源api文档项目转移到本公司的服务器之上,之前用的是showdoc,showdoc利用的是php技术,作为java程序员表示需要快速部署php环境以及apach容器都需要时间,所以采用第二种方法,即利用docker进行快速部署(虽然学习成本也不比php少)。 一、docker简介 docker的官网是https://www.docker.com,