This is a Tensorflow implementation of ResNet, compatible with Tensorflow 1.2.1.
Currently it only supports testing the 101 layer model by converting the caffemodel provided by Kaiming. Although supporting other ResNet variants and training should be quick and easy.
The caffemodel2npy.py
is modified from here, and the resnet_model.py
is modified from here.
- Download the prototxt and caffemodel provided by Kaiming
- Convert caffemodel to npy file
python caffemodel2npy.py ../ResNet/ResNet-101-deploy.prototxt ../ResNet/ResNet-101-model.caffemodel ./model/ResNet101.npy
- Convert npy file to tfmodel
python npy2tfmodel.py 0 ./model/ResNet101.npy ./model/ResNet101_init.tfmodel
- Test on a single image
python resnet_main.py 0 single
- To test on the ILSVRC12 validation set, run
python resnet_main.py 0 imagenet
The converted ResNet 101 model achieves top 5 error of 7.48% and top 1 error of 24.58% on ILSVRC12 validation set. This is without any cropping/flipping/multi-scale, using only the original image.
- Support ResNet 50 and 152
- Training code