Python影像辨識筆記(三十二):Concept Learners for Few-Shot Learning
原程式專案連結
環境建立
由於原作者repo中的README文件寫的不是很詳細,我自己fork一份後進行了一些修改,方便後續程式使用。
比較特別的是這份程式使用之前曾經介紹過的wandb,使用的時候請自己先註冊帳號並完成相關設定。除此之外,使用的是PyTorch 1.5的版本,可以考慮使用conda建立虛擬環境,避免與現有環境衝突。
PyTorch 1.5版本的安裝方式#scanpy安裝錯誤所以參考這裡解決
pip install scanpy --ignore-installed llvmlite
pip install wandb
pip install anndatagit clone https://github.com/e96031413/comet
cd comet
資料集
#CUB dataset
cd CUB/filelists/CUB/
source ./download_CUB.sh#Tabula Muris dataset
cd TM/filelists/tabula_muris/
source ./download_TM.sh
訓練及測試指令
cd comet/CUB/python ./train.py --dataset CUB --model Conv4NP --method comet --train_augpython ./test.py --dataset CUB --model Conv4NP --method comet --train_aug#其中model可以更換
Conv4 = backbone.Conv4
Conv4NP = backbone.Conv4NP
Conv4S = backbone.Conv4S
Conv6 = backbone.Conv6
Conv6NP = backbone.Conv6NP
ResNet10 = backbone.ResNet10
ResNet10NP = backbone.ResNet10NP
ResNet18 = backbone.ResNet18
ResNet34 = backbone.ResNet34
ResNet50 = backbone.ResNet50
ResNet101 = backbone.ResNet101
論文導讀