1先删除之前安装的yolov8环境(安装失败的)
conda remove -n yolov8 --all
2 创建虚拟环境
conda create -n yolov8 python=3.8.0(对应的python版本号)
3之后再把conda和pip换成清华源(详细参考以下文章)
https://blog.youkuaiyun.com/weixin_41673825/article/details/123901866 conda换源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple pip换源
4安装pytorch,具体来说打开官网,搜索与自己cuda版本适配的版本,这里我的cuda为10.2.所以
pip指令为:
conda install pytorch1.8.1 torchvision0.9.1 torchaudio0.8.1 cudatoolkit=10.2 -c pytorch
或者
conda install pytorch1.8.0 torchvision0.9.0 torchaudio0.8.0 cudatoolkit=10.2 -c pytorch
都行
5如果出现存在缓存没有删干净报错,例如SafetyError: The package for pytorch located at ***************************appears to be corrupted.之类的,使用
conda clean --all 删除缓存文件
6在github下载yolov8源码,打开文档requirments,pip install -r requirements.txt即可