# ai识别环境配置 ## 查看环境 #c 环境检查 ai识别训练因为使用`cuda`,和`python`, 所以我们需要检查一下对应的版本 #e `python`版本查看 ```shell python -V ``` 或者 ```shell python --version ``` #e `cuda`版本查看 ```shell nvcc -V ``` #e `torch`版本查看 ```shell pip show torch ``` #c 切换`torch`版本 可能有时候需要使用特定的`torch`版本, 在此时需要先使用`pip`卸载`torch`随后在安装新的`torch`版本 #e 卸载`torch` ```shell pip uninstall torch ``` #e 安装特定`torch`版本 ```shell pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html ``` ## 安装必要的环境 #c 安装 cuda #c 安装 cudnn