ai_project_v1/readme
2026-01-05 14:31:10 +08:00

70 lines
2.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

conda create -n aienv2 python=3.10
激活环境
conda create -n yolo_trt_10 python=3.10 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ --override-channels
最后安装tensorrt依赖的whl包不然gdal 安装不上
conda activate aienv
安装本地环境所需的包
//cuda 版本需要根据本地硬件做适配
同时安装ultralyticsopencv可以解决opencv 无法读取rtmp的问题
conda install -c pytorch -c nvidia -c conda-forge -c defaults pytorch torchvision pytorch-cuda=12.4 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ --override-channels
ultralytics opencv
conda install -c conda-forge sanic minio paho-mqtt sanic-cors -y
conda remove --name aimmseg --all 删除环境
# 执行清理后
conda clean --all
# 20250708 最新最新环境安装命令如下既要适配sanic的3.9及以上也要适配mmseg的torch版本
conda create -n aimmseg python=3.10
windows
pip install mmcv==2.0.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html -i https://mirrors.aliyun.com/pypi/simple/
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia
试一下torch2.0.1
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 -c pytorch -c nvidia
mamba install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 -c pytorch -c nvidia
linux
pip install mmcv==2.0.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia
pip install av -i https://mirrors.aliyun.com/pypi/simple/
pip install -U openmim -i https://mirrors.aliyun.com/pypi/simple/
pip install "mmsegmentation>=1.0.0" -i https://mirrors.aliyun.com/pypi/simple/
pip install ftfy -i https://mirrors.aliyun.com/pypi/simple/
pip install opencv-python -i https://mirrors.aliyun.com/pypi/simple/
pip install rasterio einops imageio albumentations opencv-contrib-python -i https://mirrors.aliyun.com/pypi/simple/
版本问题需要保证numpy低于 2.0
python -c "import numpy; print(numpy.__version__)"
#torch版本低需要降级numpy
pip uninstall numpy -y
pip install "numpy<2.0" # 安装 1.26.4 或更早版本
pip install numpy==1.24.4
pip install --no-deps albumentations==2.0.8 -i https://pypi.tuna.tsinghua.edu.cn/simple
mmsegmentation