Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 931 Bytes

readme.md

File metadata and controls

37 lines (28 loc) · 931 Bytes

Pretrained TF to Pytorch

Official TF Repo Official TF Repo Snapshot

Usage

  1. Download TF checkpoint
export MODEL=efficientnet-b0
wget https://storage.googleapis.com/cloud-tpu-checkpoints/efficientnet/${MODEL}.tar.gz
tar zxf ${MODEL}.tar.gz
  1. Run convert.py
python3 convert.py -h
usage: convert.py [-h] [--model MODEL] --tf_weight TF_WEIGHT
                  [--pth_weight PTH_WEIGHT]

TF EfficientNet to Pytorch EfficientNet

optional arguments:
  -h, --help            show this help message and exit
  --model MODEL
  --tf_weight TF_WEIGHT
                        Directory name to save the TF chekpoint
  --pth_weight PTH_WEIGHT
                        output PyTorch model file name

Example

python3 convert.py --model efficientnet-b0 --tf efficientnet-b0 --pth b0