一、环境配置
1、搭建环境跑github代码
1.1、例子
1、迁移元学习
真实迁移学习案例
PyTorch使用教程-迁移学习(几分钟即可训练好自己的模型)_迁移学习实战-CSDN博客
引用:https://github.com/yaoyao-liu/meta-transfer-learning/blob/main/pytorch/README.md
【傻瓜式】手把手教你搭建深度学习环境以及跑通Github代码(以Pix2PixGAN为例)_哔哩哔哩_bilibili
为了运行此存储库,我们建议您使用 Anaconda 安装 python 3.5 和 PyTorch 0.4.0。
您可以下载 Anaconda 并在其官方网站上阅读安装说明: Free Download | Anaconda
创建一个新环境,并在其上安装 PyTorch 和 torchvision:
conda create --name mtl-pytorch python=3.5
conda activate mtl-pytorch
conda install pytorch=0.4.0
conda install torchvision -c pytorch
安装其他要求:
pip install tqdm tensorboardX miniimagenettools
克隆此存储库:在你想保存的文件夹空白处右键 open git bash here输入以下命令
git clone https://github.com/yaoyao-liu/meta-transfer-learning.git
cd meta-transfer-learning/pytorch
项目架构:
.
├── data_generator
| ├── dataset_loader.py # data loader for all datasets
| └── meta_data_generator.py # samplers for meta train
├── models
| ├── mtl.py # meta-transfer class
| ├── resnet_mtl.py # resnet class
| └── conv2d_mtl.py # meta-transfer convolution class
├── trainer
| ├── pre.py # pre-train trainer class
| └── meta.py # meta-train trainer class
├── utils
| ├── gpu_tools.py # GPU tool functions
| └── misc.py # miscellaneous tool functions
├── main.py # the python file with main function and parameter settings
├── run_pre.py # the script to run pre-train phase
└── run_meta.py # the script to run meta-train and meta-test phases
2、例子
【傻瓜式】手把手教你搭建深度学习环境以及跑通Github代码(以Pix2PixGAN为例)_哔哩哔哩_bilibili
junyanz/pytorch-CycleGAN-and-pix2pix: Image-to-Image Translation in PyTorch (github.com)
前往终端先把代码下载下来解压:进入解压包所在路径,解压缩后进入,终端进入这个路径,再运行底下那个代码:
按回车,上边这种很慢,需要用镜像源下载。
第二步下载数据集并放在指定文件夹里边
搜索这个文件.sh,用记事本打开,找到一个网址URL 后边有个facades 意味下载这个文件夹
激活环境:
.
训练:安装pycharm终端运行:
3、例三
Anaconda-用conda创建python虚拟环境 - 知乎 (zhihu.com)
引用:如何下载并运行一个github深度学习项目_哔哩哔哩_bilibili
pip 形式,到底运行在哪里,
如果有环境文本文件:
4、目标检测数据集
复现Yolo目标检测:如何从github上克隆库、跑库_哔哩哔哩_bilibili
安装环境,下载数据集,安装各种库,
如何加载已经训练好的参数: . pth文件训练好的参数村的文件。
5、如何解决未引用的解析
2、如何安装一些包
3、包得导入问题
二、多GPU运算
一些pytorch库
2.1、多GPU
【精选】【PyTorch教程】07-PyTorch如何使用多块GPU训练神经网络模型_pytorch 多个gpu-CSDN博客