Installation
This section provides a tutorial on building a working environment for LibFewShot
from scratch.
Get the LibFewShot
library
Use the following command to get LibFewShot
:
cd ~
git clone https://github.com/RL-VIG/LibFewShot.git
Configure the LibFewShot
environment
The environment can be configured in any of the following ways:
conda(recommend)
cd <path-to-LibFewShot> # cd in `LibFewShot` directory conda env create -f requirements.yaml
pip
cd <path-to-LibFewShot> # cd in `LibFewShot` directory pip install -r requirements.txt
or whatever works for you as long as the following package version conditions are meet:
numpy >= 1.19.5 pandas >= 1.1.5 Pillow >= 8.1.2 PyYAML >= 5.4.1 scikit-learn >= 0.24.1 scipy >= 1.5.4 tensorboard >= 2.4.1 torch >= 1.5.0 torchvision >= 0.6.0 python >= 3.6.0
Test the installation
set the
config
as follows inrun_trainer.py
:config = Config("./config/test_install.yaml").get_config_dict()
modify
data_root
inconfig/headers/data.yaml
to the path of the dataset to be used.run code
python run_trainer.py
If the first output is correct, it means that
LibFewShot
has been successfully installed.
Next
For model training and code modification, please see the train/test methods already integrated in LibFewShot and other sections of the tutorial.