A simple implementation of the paper ImageNet Classification with Deep Convolutional Neural Networks using pytorch.
Install the required packages
pip3 install -r requirements.txt
This project is aimed to use the classic ImageNet Dataset. But due to my limited resources, I will just simply use the Mini-ImageNet Dataset I found in Kaggle.
Download and upack the dataset and change the imagenet_data_dir_train
variable into the dataset's directory in config.py.
imagenet_data_dir_train = '\ImageNet-Mini\train'
To trigger training, simply input the following command in your terminal:
python3 train.py --epochs=100 --batch_size=64 --lr=0.001 --val_split=0.2
Or you can just edit the parameters in variables in config.py and simply use:
python3 train.py
Testing in this project is very simple. You can use the following command for testing where --model_path
is the path of your pretrained model and --num_images
is the number of random images from your test dataset:
python3 test.py --model_path=mymodel.pt --num_images=10 --print=True
Similar to training, you can either input the --data_path
in your run command or simply set your test dataset's directory into the imagenet_data_dir_test
variable into the dataset's directory in [config.py].