#python版本不强制要求,但最好为3.10 #cpu环境与gpu环境根据自己有无英伟达显卡选择 #cpu环境(若虚拟环境中无pytorch,ultralytics底层自动依赖下载cpu版本的torch,如对项目的检测速度有要求请安装gpu版本的torch) ultralytics==8.0.170 onnx==1.14.1 onnxruntime==1.15.1 #gpu环境(这里安装的是gpu版本的torch,请到pytorch官网复制与你的英伟达显卡驱动所支持的cuda版本对应的安装命令,下面以cuda 11.8为例给出示例命令) # pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 (先在环境中下载好gpu版本的torch,再安装ultralytics) # pip3 install ultralytics==8.0.170