From d9ec68c8667546f24c92130230c760aa51092b9f Mon Sep 17 00:00:00 2001 From: Sebastian Bischoff Date: Fri, 10 Apr 2020 19:02:46 +0200 Subject: [PATCH 1/2] Use requirement files --- README.md | 4 +++- requirements-cpu.txt | 4 ++++ requirements-gpu.txt | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 requirements-cpu.txt create mode 100644 requirements-gpu.txt diff --git a/README.md b/README.md index d03ec2fc98..223f210455 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,11 @@ year={2019} ## Enviroment - Python3 - - [Pytorch](http://pytorch.org/) before 0.4 (for newer vesion, please see issue #3 ) + - [Pytorch](http://pytorch.org/) >= 1.0 - json +To install the dependencies use `pip3 install -r requirements-cpu.txt -f https://download.pytorch.org/whl/torch_stable.html` or `pip3 install -r requirements-gpu.txt`. + ## Getting started ### CUB * Change directory to `./filelists/CUB` diff --git a/requirements-cpu.txt b/requirements-cpu.txt new file mode 100644 index 0000000000..3e420202e2 --- /dev/null +++ b/requirements-cpu.txt @@ -0,0 +1,4 @@ +torch==1.4.0+cpu +torchvision==0.5.0+cpu +Pillow +h5py diff --git a/requirements-gpu.txt b/requirements-gpu.txt new file mode 100644 index 0000000000..9f418e5c1a --- /dev/null +++ b/requirements-gpu.txt @@ -0,0 +1,4 @@ +torch>=1.0.0 +torchvision +Pillow +h5py From 39fd8ccf5f2ad23b45fe9364f996e62806e154cf Mon Sep 17 00:00:00 2001 From: Sebastian Bischoff Date: Fri, 10 Apr 2020 19:03:19 +0200 Subject: [PATCH 2/2] Use only python3 --- README.md | 6 +++--- filelists/CUB/download_CUB.sh | 2 +- filelists/emnist/download_emnist.sh | 4 ++-- filelists/miniImagenet/download_miniImagenet.sh | 4 ++-- filelists/omniglot/download_omniglot.sh | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) mode change 100644 => 100755 filelists/CUB/download_CUB.sh diff --git a/README.md b/README.md index 223f210455..12009ec3de 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ See test.json for reference ## Train Run -```python ./train.py --dataset [DATASETNAME] --model [BACKBONENAME] --method [METHODNAME] [--OPTIONARG]``` +```python3 ./train.py --dataset [DATASETNAME] --model [BACKBONENAME] --method [METHODNAME] [--OPTIONARG]``` For example, run `python ./train.py --dataset miniImagenet --model Conv4 --method baseline --train_aug` Commands below follow this example, and please refer to io_utils.py for additional options. @@ -62,11 +62,11 @@ Commands below follow this example, and please refer to io_utils.py for addition ## Save features Save the extracted feature before the classifaction layer to increase test speed. This is not applicable to MAML, but are required for other methods. Run -```python ./save_features.py --dataset miniImagenet --model Conv4 --method baseline --train_aug``` +```python3 ./save_features.py --dataset miniImagenet --model Conv4 --method baseline --train_aug``` ## Test Run -```python ./test.py --dataset miniImagenet --model Conv4 --method baseline --train_aug``` +```python3 ./test.py --dataset miniImagenet --model Conv4 --method baseline --train_aug``` ## Results * The test results will be recorded in `./record/results.txt` diff --git a/filelists/CUB/download_CUB.sh b/filelists/CUB/download_CUB.sh old mode 100644 new mode 100755 index 395183f629..7cc35c5c8d --- a/filelists/CUB/download_CUB.sh +++ b/filelists/CUB/download_CUB.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash wget http://www.vision.caltech.edu/visipedia-data/CUB-200-2011/CUB_200_2011.tgz tar -zxvf CUB_200_2011.tgz -python write_CUB_filelist.py +python3 write_CUB_filelist.py diff --git a/filelists/emnist/download_emnist.sh b/filelists/emnist/download_emnist.sh index 6c8e9e8d1b..a93e422390 100644 --- a/filelists/emnist/download_emnist.sh +++ b/filelists/emnist/download_emnist.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash wget https://github.com/NanqingD/DAOSL/raw/master/data/emnist.zip unzip emnist.zip -python invert_emnist.py -python write_cross_char_valnovel_filelist.py +python3 invert_emnist.py +python3 write_cross_char_valnovel_filelist.py diff --git a/filelists/miniImagenet/download_miniImagenet.sh b/filelists/miniImagenet/download_miniImagenet.sh index 9db34e9188..00767cafcf 100644 --- a/filelists/miniImagenet/download_miniImagenet.sh +++ b/filelists/miniImagenet/download_miniImagenet.sh @@ -4,5 +4,5 @@ wget https://raw.githubusercontent.com/twitter/meta-learning-lstm/master/data/mi wget https://raw.githubusercontent.com/twitter/meta-learning-lstm/master/data/miniImagenet/test.csv wget http://image-net.org/image/ILSVRC2015/ILSVRC2015_CLS-LOC.tar.gz tar -zxvf ILSVRC2015_CLS-LOC.tar.gz -python write_miniImagenet_filelist.py -python write_cross_filelist.py +python3 write_miniImagenet_filelist.py +python3 write_cross_filelist.py diff --git a/filelists/omniglot/download_omniglot.sh b/filelists/omniglot/download_omniglot.sh index 3ac1921e83..b3ef79114e 100644 --- a/filelists/omniglot/download_omniglot.sh +++ b/filelists/omniglot/download_omniglot.sh @@ -14,6 +14,6 @@ mv $DATADIR/images_evaluation/* $DATADIR/ rmdir $DATADIR/images_background rmdir $DATADIR/images_evaluation -python rot_omniglot.py -python write_omniglot_filelist.py -python write_cross_char_base_filelist.py +python3 rot_omniglot.py +python3 write_omniglot_filelist.py +python3 write_cross_char_base_filelist.py \ No newline at end of file