
文章目录深度学习常用研发项目及所需依赖包准备工作环境一大模型训练/推理 Web后端环境二视觉检测 姿态识别 标注环境三autogluon自动化学习环境部署深度学习常用研发项目及所需依赖包1autogluon自动化学习需要pytorch-gpu、autogluon-gpu、pandas、numpy、pathlib、logging、collections、re、ast、scikit-learn2deepseek本地运行和训练需要pytorch-gpu、transformers、peft、datasets、json3deepseek局域网web多人交互需要open-webui、ollama、 bitsandbytes、accelerate、transformers4fastapi和stm32通信需要ollama、fastapi、uvicorn、pyserial、matplotlib、requests5语音识别openai-wgisper6摄像头姿态检测需要mediapipe、opencv、mediapipe、pydirectinput、threading、collections 、time 、random7摄像头目标检测需要ultralytics、PIL、opencv、labelimg其中环境一autogluon自动化学习单独环境环境二deepseek本地运行和训练、deepseek局域网web多人交互、语音识别共用环境注意open-webui 绝对不要装进 Conda 环境。它依赖 Node.js、npm 和特定的前端构建工具链会污染 Python 环境变量导致 pydantic、anyio 等核心库版本被强行锁定FastAPI 会直接罢工。环境三目标检测、姿态检测、图像分割共用环境准备工作预先在Anaconda的base环境中安装Mamba并配置好清华/中科大镜像源。conda update conda condainstallmamba-nbase-cconda-forge mamba--version# 验证安装成功详细访问见文章https://blog.csdn.net/sinat_30065705/article/details/163955852?fromshareblogdetailsharetypeblogdetailsharerId163955852sharereferPCsharesourcesinat_30065705sharefromfrom_link环境一大模型训练/推理 Web后端任务DeepSeek运行/训练 局域网Web交互(除UI) FastAPI通信 语音识别官方推荐open-webui用docker安装# 下载docker并安装 https://www.docker.com/products/docker-desktop/# 拉取需要的Open WebUI镜像dockerpull ghcr.io/open-webui/open-webui:main# 导出镜像为文件dockersave ghcr.io/open-webui/open-webui:main-oopen-webui.tar# 使用 load 命令将 .tar 文件加载为Docker镜像dockerload-iopen-webui.tar# 启动open-webui服务dockerrun-d-p3000:8080 --add-hosthost.docker.internal:host-gateway-vopen-webui:/app/backend/data--nameopen-webui ghcr.io/open-webui/open-webui:main为了省事我还是单独创建环境只安装open-webuimamba create-nopen_webuipython3.11-ymamba activate open_webui pipinstallopen-webui-ihttps://pypi.tuna.tsinghua.edu.cn/simplemamba create-nllm_apipython3.11-ymamba activate llm_api# PyTorch GPUCUDA 12.4mambainstallpytorch torchvision torchaudio pytorch-cuda12.4-cpytorch-cnvidia-y# Transformers生态mambainstalltransformers accelerate peft datasets scikit-learn-cconda-forge-y# bitsandbytes必须用pipconda版容易编译失败pipinstallbitsandbytes-ihttps://pypi.tuna.tsinghua.edu.cn/simple# Web服务 通信 工具pipinstallfastapi uvicorn pyserial requests matplotlib ollama-ihttps://pypi.tuna.tsinghua.edu.cn/simple# 语音识别Whisper 依赖 torchaudio 已装pipinstallopenai-whisper-ihttps://pypi.tuna.tsinghua.edu.cn/simple# 我选择的是国产的Fun-ASR模型pipinstallfunasr[all]-ihttps://pypi.tuna.tsinghua.edu.cn/simple# 若报错清理缓存后再试即可mambainstall-cffmpeg-y# 安装 modelscope 库pipinstallmodelscope# 下载 Fun-ASR-Nano-2512 模型默认下载到 C:\Users\Administrator\.cache\modelscope\models\FunAudioLLM--Fun-ASR-Nano-2512modelscope download--modelFunAudioLLM/Fun-ASR-Nano-2512环境二视觉检测 姿态识别 标注任务姿态检测 目标检测 标注工具(使用社区版labelimg官方只支持python3.9)mamba create-ncv_envpython3.11-ymamba activate cv_env# PyTorch GPU和llm_api共享同一份物理文件节省空间mambainstallpytorch torchvision torchaudio pytorch-cuda12.4-cpytorch-cnvidia-y# YOLO OpenCV Mediapipemambainstallultralytics opencv-cconda-forge-y# 纯pip库pipinstallmediapipe pydirectinput pillow pyautogui-ihttps://pypi.tuna.tsinghua.edu.cn/simple# LabelImg社区修复版需提前安装gitpipinstallgithttps://github.com/biantsh/labelImgPlus.git# 或直接安装预编译版labelimgplusplus不指定版本会有库冲突# 或者单独创建一个标注工具环境不用指定版本pipinstalllabelimgplusplus3.0.0环境三autogluon自动化学习环境部署任务AutoGluon自动化学习mamba create-nautogluon_envpython3.11-ymamba activate autogluon_env# autogluon1.6.1 要求torch2.14,2.10pipinstalltorch2.10.0torchvision0.25.0torchaudio2.10.0 --index-url https://download.pytorch.org/whl/cu130# 用于读取excel数据pipinstallopenpyxl# 直接安装 AutoGluon自动拉取 PyTorch、numpy、pandas、ray、scikit-learn等依赖mambainstall-cconda-forge-cpytorch-cnvidia autogluonpytorch**cuda*-y若报缓存错误则手动进入anaconda安装目录中的\pkgs文件夹删除 https 整个文件夹如果存在以及所有以 cookiecutter 开头的文件夹和 .conda 文件。再运行以下命令后重新安装conda clean--all-y若还是报错则重新指定缓存文件夹# 设置新的缓存路径例如 D 盘setCONDA_PKGS_DIRSD:\conda_pkgs# 清理旧索引缓存conda clean-i-y# 再次尝试安装# 安装完恢复pkgs原有路径并手动删除临时位置conda config--addpkgs_dirs C:\Users\Administrator\anaconda3\pkgs若还是不行就要pip安装# 会自动安装ray、scikit-learn等依赖包pipinstallautogluon#如果报mxnet的错误mambainstall-cconda-forge mxnet安装好后进入python测试一开始装的pytorch-gpu还在不在不在的话卸载autogluon自行安装的cpu版torch重新安装gpu版的torchimporttorchprint(torch.cuda.is_available())# 应为 Trueprint(torch.__version__)# 确认版本# 先卸载pip uninstall torch torchvision torchaudio-y# 再安装注意torch版本号和cuda版本号的对应pipinstalltorch2.10.0torchvision0.25.0torchaudio2.10.0 --index-url https://download.pytorch.org/whl/cu130