----------------未完
0.前言
ubuntu18.04 cpu版本 pytorch
1.配置环境
选择python3.6版本进行配置,利用anaconda创建python=3.6的环境fcn,参考:https://github.com/wkentaro/pytorch-fcnhttps://github.com/wkentaro/pytorch-fcn
- pytorch >= 0.2.0
- torchvision >= 0.1.8
- fcn >= 6.1.5
- Pillow
- scipy
- tqdm
1.1 安装fcn包:
pip install fcn
#pip install --default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple fcn
1.2 安装PyTorch:
进入PyTorch官网,下载cpu版本:
Start Locally | PyTorchhttps://pytorch.org/get-started/locally/
复制网页的命令,我的如下:
conda install pytorch torchvision torchaudio cpuonly -c pytorch
#或者pip
pip3 install torch==1.10.2+cpu torchvision==0.11.3+cpu torchaudio==0.10.2+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
验证安装:
clash$ conda activate py36
(py36) clash$ python
Python 3.6.13 |Anaconda, Inc.| (default, Jun 4 2021, 14:25:59)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
False
>>>
1.3 安装pillow、scipy、tqdm
pip install pillow
pip install scipy
pip install tqdm
1.4 验证环境配置
下载 https://github.com/wkentaro/pytorch-fcnhttps://github.com/wkentaro/pytorch-fcn 的代码并解压,pip install .后出现下面一堆successfully。
(py36) paper1$ cd pytorch-fcn-main/
(py36) pytorch-fcn-main$ pip install . ######安装torchfcn
Processing /home/elfoot/paper1/pytorch-fcn-main
Preparing metadata (setup.py) ... done
--------------------------------
Requirement already satisfied: idna<4,>=2.5 in /home/elfoot/anaconda3/envs/py36/lib/python3.6/site-packages (from requests[socks]->gdown->fcn>=6.1.5->torchfcn==1.9.7) (3.3)
Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /home/elfoot/anaconda3/envs/py36/lib/python3.6/site-packages (from requests[socks]->gdown->fcn>=6.1.5->torchfcn==1.9.7) (1.7.1)
Building wheels for collected packages: torchfcn
Building wheel for torchfcn (setup.py) ... done
Created wheel for torchfcn: filename=torchfcn-1.9.7-py3-none-any.whl size=137110 sha256=0e0a02e7459ab0c07e029ccefb4d80959a61ee28a9d4a052ea8574855f7c488f
Stored in directory: /home/elfoot/.cache/pip/wheels/c9/60/99/c1bd09fc67e214cb878410d34a27c1a3ac13a0e4f22bddbadf
Successfully built torchfcn
Installing collected packages: torchfcn
Successfully installed torchfcn-1.9.7
2.利用VOC数据集训练example
正在下载数据集-----很慢----不知有没有快的方法
参考链接:
Ubuntu18.04安装cpu版pytorch环境 - 简书https://www.jianshu.com/p/43f66c69baa7https://github.com/pytorch/pytorch#installation
https://github.com/pytorch/pytorch#installation