我装这个环境是为了尝试商汤的 pysot https://blog.csdn.net/zjc910997316/article/details/90749847
运行环境如下:
Requirement:
- Conda with Python 3.7. ok
- Nvidia GPU. ok
- PyTorch 0.4.1 我的是1.1.0
- yacs
- pyyaml
- matplotlib
- tqdm
- OpenCV
1 安装步骤
安装步骤如下:https://github.com/STVIR/pysot/blob/master/INSTALL.md
Requirments
- Conda with Python 3.7.
- Nvidia GPU.
- PyTorch 0.4.1
- yacs
- pyyaml
- matplotlib
- tqdm
- OpenCV
1 Step-by-step instructions
1 Create environment and activate
PS:conda指令介绍创建环境:https://blog.csdn.net/zjc910997316/article/details/93662410
conda create --name pysot python=3.7
PS:此步骤之后会有很长的下载时间,这里是创造另外一个环境。
conda activate pysot
1 PS:列举当前所有环境
conda env list
或者conda info --envs
2 PS: 因为我已经在 base(root) 环境安装co过 torch python 等,所以激活环境即可,在进行下面的
base 环境里面的已经安装的包如下
2 Install numpy/pytorch/opencv
conda install numpy
conda install pytorch=0.4.1 torchvision cuda90 -c pytorch #
pip install opencv-python
1
conda install pytorch=0.4.1 torchvision cuda90 -c pytorch
这个还是按照我的另外一个博客的安装方法安装吧(想一句话吧pytorch torchvision cuda都安装了还是挺难的)
https://blog.csdn.net/zjc910997316/article/details/92380092
PS:这里不明白安装了numpy还可以再安装,pytorch不用安装了吧,我跳过了
conda install numpy 全部过程如下
更新了conda
(base) C:\Users\Administrator>conda install numpy Collecting package metadata: done Solving environment: done ## Package Plan ## environment location: G:\nk_deeplearning\Anaconda added / updated specs: - numpy The following packages will be downloaded: package | build ---------------------------|----------------- conda-4.7.5 | py37_0 3.0 MB conda-package-handling-1.3.10| py37_0 280 KB ------------------------------------------------------------ Total: 3.3 MB The following NEW packages will be INSTALLED: conda-package-han~ pkgs/main/win-64::conda-package-handling-1.3.10-py37_0 The following packages will be UPDATED: conda 4.6.14-py37_0 --> 4.7.5-py37_0 Proceed ([y]/n)? y Downloading and Extracting Packages conda-package-handli | 280 KB | #################################### | 100% conda-4.7.5 | 3.0 MB | #################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done
pip install opencv-python 全过程如下
查看numpy, opencv版本
3 Install other requirements
pip install pyyaml yacs tqdm colorama matplotlib cython tensorboardX
PS:版本如下
4 Build extensions
python setup.py build_ext --inplace
PS:
在之前 https://github.com/STVIR/pysot 网址下载的内容所在文件位置
打开终端(按住shft右键- > 选择在此处打开终端),
激活对应的环境 conda actvate base,
输入相应指令 python setup.py build_ext --inplace
PS: 出现问题
2 Try with scripts
PS:这里是使用脚本语言安装,我按照上面一步一步安装的,这里跳过
bash install.sh /path/to/your/conda pysot
2 查看版本
1 python 版本--3.7.7
win+r
cmd
python
2 cuda 版本---10.1
win+r
cmd
nvcc -V
3 判断gpu可用
import torch
print('GPU是否可用:', True if torch.cuda.is_available() else False)
4 torch 版本---1.1.0
import torch
print(torch.__version__)
5 torchvision 版本---0.3.0
import torchvision
print(torchvision.__version__)