在矩池雲上覆現 CVPR 2018 LearningToCompare_FSL 環境

這是 CVPR 2018 的一篇少樣本學習論文:Learning to Compare: Relation Network for Few-Shot Learning

源碼地址:https://github.com/floodsung/LearningToCompare_FSL

環境選用 Tensorflow 1.4 因爲他是 cuda8 的。

切換conda源

bash /public/script/switch_conda_source.sh

創建虛擬python環境

conda create -n py27 python=2.7

conda deactivate
conda activate py27

安裝 torch 0.3

接下來的任務是找 torch 0.3 的whl安裝包,我從下面的鏈接中找到了

https://download.pytorch.org/whl/cu80/torch_stable.html

我這裏是直接pip,複製下面的命令即可。

pip install https://download.pytorch.org/whl/cu80/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
pip install torchvision==0.2.1
pip install matplotlib scipy

pip list

拉取github庫

git clone https://github.com/brendenlake/omniglot.git

我這裏用了一個github鏡像來完成

git clone https://hub.fastgit.org/floodsung/LearningToCompare_FSL.git
cd LearningToCompare_FSL/
ls

解壓文件並測試運行

cd /LearningToCompare_FSL/datas
unzip omniglot_28x28.zip
cd /LearningToCompare_FSL/omniglot
python omniglot_train_one_shot.py -w 5 -s 1 -b 19 

查看有沒有使用到gpu

nvidia-smi -l 5

查看文章

矩池雲上如何加速 GitHub 下載?

矩池雲上執行 conda install 的時候下載特別慢怎麼辦?怎麼切換源?

https://pytorch.org/get-started/previous-versions/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章