MMDetection3D+waymo-open-dataset-tf-2-6-0+pytorc2.3.1+cu121安装

news/2024/9/21 22:34:38

安装pytorc2.3.1+cu121

步骤 1. 创建并激活一个 conda 环境

conda create -n mmd python=3.8 -y
conda activate mmd

步骤 2. 基于PyTorch 官方说明安装 PyTorch,例如:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

步骤 3. 验证PyTorch安装

[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True

安装waymo-open-dataset-tf-2-6-0

步骤 1. 安装waymo-API

pip install waymo-open-dataset-tf-2-6-0

步骤 2. 处理torch版本冲突

出现如下报错

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torch 2.3.1+cu121 requires typing-extensions>=4.8.0, but you have typing-extensions 3.7.4.3 which is incompatible.

更新typing-extensions

pip install typing-extensions==4.8.0

步骤 3. 处理tensorflow-2.6.0与protobuf的版本冲突

pip install protobuf==3.20.0

步骤 4. 安装tensorflow-gpu所需cudatoolkit与cudnn

conda install cudatoolkit=11.3.1 cudnn=8.2.1

步骤 5. 验证torch与tensorflow安装

Python 3.8.19 (default, Mar 20 2024, 19:58:24) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import tensorflow as tf
>>> torch.cuda.is_available()
True
>>> tf.test.is_gpu_available()
WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2024-06-24 10:36:35.105410: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-06-24 10:36:35.106672: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:36:35.114045: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:36:35.114108: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:36:35.165378: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:36:35.165449: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:36:35.165495: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:36:35.165545: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1510] Created device /device:GPU:0 with 20170 MB memory:  -> device: 0, name: NVIDIA GeForce RTX 4090, pci bus id: 0000:01:00.0, compute capability: 8.9
True

安装MMDetection3D

步骤 1. 使用 MIM 安装 MMEngine,MMCV 和 MMDetection

pip install -U openmim
mim install mmengine
mim install 'mmcv>=2.0.0rc4'
mim install 'mmdet>=3.0.0'

步骤 2. 处理openmim与tensorflow的版本冲突

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 2.6.0 requires numpy~=1.19.2, but you have numpy 1.24.4 which is incompatible.
tensorflow 2.6.0 requires typing-extensions~=3.7.4, but you have typing-extensions 4.8.0 which is incompatible.

参考issues#2858安装numpy==1.23.0

pip install numpy==1.23.0

步骤 2. 安装 MMDetection3D

下载源码备用

git clone https://github.com/open-mmlab/mmdetection3d.git -b dev-1.x
# "-b dev-1.x" 表示切换到 `dev-1.x` 分支。
cd mmdetection3d

将 mmdet3d 作为依赖或第三方 Python 包使用,使用 MIM 安装

mim install "mmdet3d>=1.1.0rc0"

验证安装

步骤 1. 验证mmdet3d

mim download mmdet3d --config pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car --dest .
python demo/pcd_demo.py demo/data/kitti/000008.bin pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20220331_134606-d42d15ed.pth --show

步骤 2. 验证pytorch与tensorflow

Python 3.8.19 (default, Mar 20 2024, 19:58:24) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import tensorflow as tf
>>> torch.cuda.is_available()
True
>>> tf.test.is_gpu_available()
WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2024-06-24 10:47:24.233284: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-06-24 10:47:24.234634: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:47:24.237583: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:47:24.237644: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:47:24.267267: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:47:24.267336: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:47:24.267382: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-06-24 10:47:24.267431: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1510] Created device /device:GPU:0 with 19665 MB memory:  -> device: 0, name: NVIDIA GeForce RTX 4090, pci bus id: 0000:01:00.0, compute capability: 8.9
True
>>> 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ryyt.cn/news/47195.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

IMX6ULL开发板spi OLED驱动

本文是IMX6ULL开发板spi OLED驱动学习笔记,方便后面查看时快速的回顾,而不需要一点点的看视频 视频地址: https://www.bilibili.com/video/BV1Yb4y1t7Uj?p=144&spm_id_from=pageDriver&vd_source=1d93d6a5e22d4b223c6c3ac4f5727eb8 视频选集:P141 - P150 1、将文件…

fdisk时WARNING: Re-reading the partition table failed with error 16: 设备或资源忙 的问题解决方案

WARNING: Re-reading the partition table failed with error 16: 设备或资源 现象:划分磁盘有警告, WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.The kernel still uses the old table. The new table will be used atthe next reboot or…

飞行器飞行动力学总结

飞行器飞行动力学总结 基本空气动力学原理标准大气压 101325 Pa = 1 atm 海平面大气密度 1.225 Kg/m3 标准情况下的大气 R = 287 J/(kgK)引言 影响飞机性能、稳定性、操纵性的关键参数 雷诺数 \(Re=\dfrac{\rho V_{\infty} L}{\mu}\) :惯性力与粘性力的比值 牛顿流体指的是满…

python画出的图片设置单独弹窗

我用python画图pycharm总是右边弹窗,看起来很别扭,想让它正中央显示,并且有保存按钮修改流程(借鉴yuanyuan_zyy的方法): 结果:

10. Mybatis 参数处理

环境准备: 创建模块 ,引入相关依赖 和 配置文件 创建数据库表:t_student ​​ 向数据库表中填充数据 ​​创建pojo类 :student public class Student {private Long id;private String name;private Integer age;private Double height;private Date birth;private Charact…

【C++】【MFC】MFC多文档框架

相较于单文档架构,多文档基本架构则是有起码两个框架窗口,与其相对应的也会有两个文档类进行数据管理。 参与架构的类:CMDIFrameWnd / CMDIChildWnd / CWinApp / CView / CDocument 需要用的类:CDocTemplate(文档模板类)|-> CMultiDocTemplate(多文档模板类)CDocMan…

网络物理隔离后 可以用保密U盘进行数据安全交换吗?

企业用的保密U盘通常被设计用于存储和传输敏感信息,以确保数据的安全和保密性。在网络之间实现了物理隔离后,使用保密U盘进行数据安全交换是一种常见的做法。物理隔离确保了两个网络之间的完全分离,因此使用保密U盘可以作为一种安全的手段来在这两个网络之间传输数据。 以下…

CTH: 谁帮我切开这个蛋糕???

$\quad $ 看到CTH立马就开始做了好吧,很适合当做入门题。$\quad $ 首先定义 \(f[i]\) 表示进行到第 \(i\) 位时的答案数,\(bit\) 数组表示 \(01\) 序列。那么当 \(bit[i]\) 为 \(1\) 时,有 \[f[i]=\Sigma_{j=i+1}^{n+1} f[j] \]$\quad $ 至于为什么循环到 \(n+1\) ,循环到第…