Skip to content

ResNet-18 TensorFlow Implementation including conversion of torch .t7 weights into tensorflow ckpt

Notifications You must be signed in to change notification settings

leicao-me/resnet-18-tensorflow

 
 

Repository files navigation

resnet-18-tensorflow

A TensorFlow implementation of ResNet-18(https://arxiv.org/abs/1512.03385)

Prerequisite

  1. TensorFlow 1.0
  2. The ImageNet dataset
  • All image files are required to be valid JPEG files. See this gist.
  • It is highly recommened for every image to be resized so that the shorter side is 256.
  1. (Optional) Torchfile(to convert ResNet-18 .t7 checkpoint into tensorflow checkpoint. Install with a command pip install torchfile)

How To Run

  • (Optional) Convert torch .t7 into tensorflow ckpt
# Download the ResNet-18 torch checkpoint
wget https://d2j0dndfm35trm.cloudfront.net/resnet-18.t7
# Convert into tensorflow checkpoint
python extract_torch_t7.py
  1. Modify train_scratch.sh(training from scratch) or train.sh(finetune pretrained weights) to have valid values of following arguments
  • train_dataset, train_image_root, val_dataset, val_image_root: Path to the list file of train/val dataset and to the root
  • num_gpus and corresponding IDs of GPUs(CUDA_VISIBLE_DEVICES at the first line)
  1. Run!
  • ./train_scratch.sh or ./train.sh

About

ResNet-18 TensorFlow Implementation including conversion of torch .t7 weights into tensorflow ckpt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.9%
  • Shell 3.1%