This repository contains an implementation of convolution neural networks using Jittor that classfies species of dogs using Tsinghua Dogs Dataset. The dataset is provided in this link.
Step1: Install Requirements To install all the packages required to run the codes, enter the following to the terminal.
git clone https://github.com/georgeNakayama/ThuDogs.git
cd ThuDogs
python -m pip install -r requirements.txtIf you have any installation problems for Jittor, please refer to Jittor
Step2: Setup Environment Variable Now we need to setup enviroment variable to run the python scripts. Add
export PYTHONPATH=$PYTHONPATH:{you_own_path}/ThuDogsto .bashrc or .zshrc depending on the shell you use.
Then, run
source .bashrcor
source .zshrcrespectively. You are good to go.
ThuDogs runs all of its training and testing through config-file. Please refer to config.md for details.
Download and unzip the Tsinghua Dogs Dataset by running from ThuDogs directory
python tools/process.py --download --zip --save_dir {destination to save the dataset}To use the dataset, we need to change the directory name for the images to images, the annotations to annotations and the train/validation split list directory to datalist.
We now support the training of two types of networks. One of them is Resnet50. To train this network we can run
python tools/main.py --config-file config/rnet50-sgd-consine-cusdataset.py --task=trainTo resume a training using checkpoints, add resume_path={you_checkpointspath} to the last line of the config file.
The second network we support is PMG where the training can be run by typing
python tools/main.py --config-file config/PMG-sgd-consine-custdataset.py --task=train --pmgto the shell.