ResNet-18 TensorFlow Implementation including conversion of torch .t7 weights into tensorflow ckpt
A TensorFlow implementation of ResNet-18(https://arxiv.org/abs/1512.03385)
Prerequisite
pip install torchfile
)How To Run
# Download the ResNet-18 torch checkpoint
wget https://d2j0dndfm35trm.cloudfront.net/resnet-18.t7
# Convert into tensorflow checkpoint
python extract_torch_t7.py
train_scratch.sh
(training from scratch) or train.sh
(finetune pretrained weights) to have valid values of following argumentstrain_dataset
, train_image_root
, val_dataset
, val_image_root
: Path to the list file of train/val dataset and to the rootnum_gpus
and corresponding IDs of GPUs(CUDA_VISIBLE_DEVICES
at the first line)./train.sh
if you want to finetune the converted ResNet(NOTE: The model needs to be finetuned for some epochs)./train_scratch.sh
if you want to train ResNet from scratch./eval.sh
for evaluating the trained model(change the arguments in eval.sh
to your preference)Note
./train.sh
) to get the full performance(If you run the evaluation code without finetuning, the single-crop top-1 validation accuracy is about 60%, which is less than the appeared in the original). I guess there is some minor issue that I have missed.