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

安装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
>>> 

pip list

Package                     Version       Editable project location
--------------------------- ------------- -------------------------
absl-py                     0.15.0
addict                      2.4.0
aliyun-python-sdk-core      2.15.1
aliyun-python-sdk-kms       2.16.3
asttokens                   2.4.1
astunparse                  1.6.3
attrs                       23.2.0
backcall                    0.2.0
black                       24.4.2
blinker                     1.8.2
cachetools                  5.3.3
certifi                     2024.6.2
cffi                        1.16.0
charset-normalizer          3.3.2
clang                       5.0
click                       8.1.7
colorama                    0.4.6
comm                        0.2.2
ConfigArgParse              1.7
contourpy                   1.1.1
crcmod                      1.7
cryptography                42.0.8
cycler                      0.12.1
dash                        2.17.1
dash-core-components        2.0.0
dash-html-components        2.0.0
dash-table                  5.0.0
decorator                   5.1.1
descartes                   1.1.0
easydict                    1.13
exceptiongroup              1.2.1
executing                   2.0.1
fastjsonschema              2.20.0
filelock                    3.14.0
fire                        0.6.0
flake8                      7.1.0
Flask                       3.0.3
flatbuffers                 1.12
fonttools                   4.53.0
fsspec                      2024.2.0
gast                        0.4.0
google-auth                 2.30.0
google-auth-oauthlib        1.0.0
google-pasta                0.2.0
grpcio                      1.64.1
h5py                        3.1.0
idna                        3.7
imageio                     2.34.1
importlib_metadata          7.2.1
importlib_resources         6.4.0
iniconfig                   2.0.0
ipython                     8.12.3
ipywidgets                  8.1.3
itsdangerous                2.2.0
jedi                        0.19.1
Jinja2                      3.1.3
jmespath                    0.10.0
joblib                      1.4.2
jsonschema                  4.22.0
jsonschema-specifications   2023.12.1
jupyter_core                5.7.2
jupyterlab_widgets          3.0.11
keras                       2.15.0
Keras-Preprocessing         1.1.2
kiwisolver                  1.4.5
llvmlite                    0.41.1
lyft-dataset-sdk            0.0.8
Markdown                    3.6
markdown-it-py              3.0.0
MarkupSafe                  2.1.5
matplotlib                  3.5.3
matplotlib-inline           0.1.7
mccabe                      0.7.0
mdurl                       0.1.2
mmcv                        2.1.0
mmdet                       3.2.0
mmdet3d                     1.4.0
mmengine                    0.10.4
model-index                 0.1.11
MotionTransformer           0.1.0+a5ba7bd /home/lhc/codes/pbp/MTR
mpmath                      1.3.0
mypy-extensions             1.0.0
nbformat                    5.10.4
nest-asyncio                1.6.0
networkx                    3.0
numba                       0.58.1
numpy                       1.23.0
nuscenes-devkit             1.1.11
nvidia-cublas-cu12          12.1.3.1
nvidia-cuda-cupti-cu12      12.1.105
nvidia-cuda-nvrtc-cu12      12.1.105
nvidia-cuda-runtime-cu12    12.1.105
nvidia-cudnn-cu12           8.9.2.26
nvidia-cufft-cu12           11.0.2.54
nvidia-curand-cu12          10.3.2.106
nvidia-cusolver-cu12        11.4.5.107
nvidia-cusparse-cu12        12.1.0.106
nvidia-nccl-cu12            2.20.5
nvidia-nvjitlink-cu12       12.1.105
nvidia-nvtx-cu12            12.1.105
oauthlib                    3.2.2
open3d                      0.18.0
opencv-python               4.10.0.84
opendatalab                 0.0.10
openmim                     0.3.9
openxlab                    0.1.0
opt-einsum                  3.3.0
ordered-set                 4.1.0
oss2                        2.17.0
packaging                   24.1
pandas                      2.0.3
parso                       0.8.4
pathspec                    0.12.1
pexpect                     4.9.0
pickleshare                 0.7.5
pillow                      10.2.0
pip                         24.0
pkgutil_resolve_name        1.3.10
platformdirs                4.2.2
plotly                      5.22.0
pluggy                      1.5.0
plyfile                     1.0.3
prompt_toolkit              3.0.47
protobuf                    3.20.0
ptyprocess                  0.7.0
pure-eval                   0.2.2
pyasn1                      0.6.0
pyasn1_modules              0.4.0
pycocotools                 2.0.7
pycodestyle                 2.12.0
pycparser                   2.22
pycryptodome                3.20.0
pyflakes                    3.2.0
Pygments                    2.18.0
pyparsing                   3.1.2
pyquaternion                0.9.9
pytest                      8.2.2
python-dateutil             2.9.0.post0
pytz                        2023.4
PyWavelets                  1.4.1
PyYAML                      6.0.1
referencing                 0.35.1
requests                    2.28.2
requests-oauthlib           2.0.0
retrying                    1.3.4
rich                        13.4.2
rpds-py                     0.18.1
rsa                         4.9
scikit-image                0.19.3
scikit-learn                1.3.2
scipy                       1.10.1
setuptools                  60.2.0
Shapely                     1.8.5.post1
six                         1.15.0
stack-data                  0.6.3
sympy                       1.12
tabulate                    0.9.0
tenacity                    8.4.1
tensorboard                 2.14.0
tensorboard-data-server     0.7.2
tensorboardX                2.6.2.2
tensorflow                  2.6.0
tensorflow-estimator        2.15.0
termcolor                   1.1.0
terminaltables              3.1.10
threadpoolctl               3.5.0
tifffile                    2023.7.10
tomli                       2.0.1
torch                       2.3.1+cu121
torchaudio                  2.3.1+cu121
torchvision                 0.18.1+cu121
tqdm                        4.65.2
traitlets                   5.14.3
trimesh                     4.4.1
triton                      2.3.1
typing_extensions           4.8.0
tzdata                      2024.1
urllib3                     1.26.19
waymo-open-dataset-tf-2-6-0 1.4.9
wcwidth                     0.2.13
Werkzeug                    3.0.3
wheel                       0.43.0
widgetsnbextension          4.0.11
wrapt                       1.12.1
yapf                        0.40.2
zipp                        3.19.2
posted @ 2024-06-24 10:48  叫我小辰就好了  阅读(86)  评论(0编辑  收藏  举报