yolov5 环境设置(暂记)

该文详细列举了一系列Python环境配置的步骤,包括使用conda和pip安装不同库,如numpy、matplotlib和torch等,并处理了遇到的protobuf版本冲突和numpy相关错误。还提到了环境迁移的方法以及针对Yolov8模型的环境设置简化。此外,指出了使用清华源加速下载和Docker容器的相关操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

直接安装

conda activate -n ntroch python=3.7  
pip install setuptools==57.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple# 在执行批量安装命令pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple之前,先执行pip install setuptools==57.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple 命令
pip install numpy==1.19.3 matplotlib==3.2.2 tensorboard==2.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.2 -c pytorch 或 pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html# 解决CUDA error: no kernel image is available for execution on the device  
pip install onnx==1.12.0  // https://onnxruntime.ai/docs/get-started/with-python.html

环境迁移的方法(迁移链接)

使用conda pack进行环境迁移
pip install conda-pack
conda pack -n envname

sudo mkdir nyolo
tar -xzvf yolotest.tar.gz 
source activate nyolo
pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

踩坑记录

pip install tensorboard==2.4.1
pip install pandas
pip install opencv-python==4.5.1.48 -i https://pypi.tuna.tsinghua.edu.cn/simple
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
pip install protobuf==3.15.8
AttributeError: module ‘numpy‘ has no attribute ‘object‘// https://blog.youkuaiyun.com/AliceH1226/article/details/128821182
pip install numpy==1.18.5 matplotlib==3.2.2 tensorboard==2.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install numpy==1.21.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
    from . import ft2font
ImportError: numpy.core.multiarray failed to import
pip install numpy==1.18.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install pandas==1.3.1
matplotlib==3.3.4
seaborn
pip install numpy==1.19.3 matplotlib==3.2.2 tensorboard==2.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

docker

在这里插入图片描述

cg

  • 到了yolov8环境设置更简单了https://github.com/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb
    • https://mirrors.bfsu.edu.cn/pypi/web/simple
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值