ResNet variations for TensorFlow.
This repository contains TensorFlow Keras ResNet models. Below, you will find the supported variants of ResNet and what weights are supported.
This repository is compatible with TF 2.2.0 even though grouped convolutions are only
supported in TF Nightly.
Grouped convolutions will be imported from
convolutions.py which is the TF Nightly version of convolution layers.
This allows the use of TPUs since they don't work with TF Nightly.
These models will not work without a GPU or TPU due to the use of grouped convolutions.
To install, you can use
pip install tf2-resnets.
To use a model, you can do
from tf2_resnets import models # Weights here are ImageNet. # They can also be 'ssl' (semi-supervised) # or 'swsl' (semi-weakly supervised) # for a selection of models. model = models.ResNeXt50(input_shape=(224, 224, 3), weights='imagenet')
|Architecture||Weights||Top-1 Acc.||Top-5 Acc.|
|Wide ResNet-50 2||ImageNet||78.5||94.1|
|Wide ResNet-101 2||ImageNet||78.8||94.3|
|ResNeXt-50 32x4d||semi-weakly supervised||82.2||96.3|
|ResNeXt-101 32x8d||semi-weakly supervised||84.3||97.2|
* ResNeSt models' Top-1 Accuracies were reported using different crop sizes. Crop sizes in order - 224, 256, 320, and 416.
There are two different preprocessing functions which are meant to be used
according to the task at hand. The first one, located in
is meant to be used for reproducing the ImageNet results. The second function
is located inside
resnet.py. This function is meant to be used for transfer learning.
The first function includes an additional resize to 256 by 256 and a central crop to 224 by 224.
The original implementions of these models are listed below.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size tf2_resnets-0.3.0-py3-none-any.whl (28.7 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size tf2-resnets-0.3.0.tar.gz (27.2 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for tf2_resnets-0.3.0-py3-none-any.whl