|
Download clean/video/mintime/models/efficientnet/tf_to_pytorch/README.md from deepsafe/model-code: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/deepsafe/model-code/resolve/main/clean/video/mintime/models/efficientnet/tf_to_pytorch/README.md
- Command line
-
hf download hf://deepsafe/model-code/clean/video/mintime/models/efficientnet/tf_to_pytorch/README.md
-
curl -L -o README.md https://huggingface.co/deepsafe/model-code/resolve/main/clean/video/mintime/models/efficientnet/tf_to_pytorch/README.md
1.01 kB
TensorFlow to PyTorch Conversion
This directory is used to convert TensorFlow weights to PyTorch. It was hacked together fairly quickly, so the code is not the most beautiful (just a warning!), but it does the job. I will be refactoring it soon.
I should also emphasize that you do not need to run any of this code to load pretrained weights. Simply use EfficientNet.from_pretrained(...).
That being said, the main script here is convert_to_tf/load_tf_weights.py. In order to use it, you should first download the pretrained TensorFlow weights:
cd pretrained_tensorflow
./download.sh efficientnet-b0
cd ..
Then
mkdir -p pretrained_pytorch
cd convert_tf_to_pt
python load_tf_weights.py \
--model_name efficientnet-b0 \
--tf_checkpoint ../pretrained_tensorflow/efficientnet-b0/ \
--output_file ../pretrained_pytorch/efficientnet-b0.pth