colab使用教程
cocolab使用教程
1 準備數據集
切換路徑并用wget 下載coco和wikiart數據集,并用unzip解壓數據集
%cd /content/drive/Shared\ drives/MySharedDrive/dataset !pwd !ls !wget http://images.cocodataset.org/zips/train2017.zip !wget http://web.fsktm.um.edu.my/~cschan/source/ICIP2017/wikiart.zip !unzip train2017.zip !unzip wikiart.zip2 安裝環境
根據python 版本以及cuda版本選擇安裝pytorch
查看python版本、cuda版本
!python --version !nvcc --version !nvidia-smi根據版本安裝
!pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html測試pytorch是否可以調用gpu
import torch print(torch.cuda.is_available())3 切換到項目路徑
切換到項目路徑
!pwd %cd /content/drive/Shared\ drives/MySharedDrive/code/MAST !pwd !ls3.1 訓練
nohup python -u train_autoencoder.py --output_path ../../results/train/vgg_decoder_with_connection/cascade_connection/r41/exp2-cascade-weight-1e-7 --perceptual_loss_weight 1e-7 --batch_size 8 --layer_list r41 --content_layers r41,r31,r21,r11 --cascade_weight 1e-7 --gpu 0 > ../../log/train_vgg_with_skip_cascade_connection_r41-exp2-cascade-weight-1e-7.log 2>&1 &3.2 測試
!ls %cd /content/drive/Shared\ drives/MySharedDrive/code/MAST/test !python test.py --gpu 0 --is_batch --output_path ../results/batch_test/exp1總結
- 上一篇: Exchange 2007迁移Excha
- 下一篇: 键盘流的逆袭- Idea 中使用 VIM