Skip to content

How to port TensorFlow model weights to PyTorch? #144

Answered by rwightman
jp7c5 asked this question in Q&A
Discussion options

You must be logged in to vote

My code for porting the weights is hideous, brittle, and liability for me to share in the sense that it is not self explanatory and not something I want to maintain or explain. It would require quite a bit of working to use to go go the other way.

I did find my PyTorch impl to be faster than the TF when training on GPU/multi-GPU... with mixed precision AMP & torchscript especially. I think theirs trains faster on TPU. Eager mode PyTorch in general is pretty slow for inference in the small batch regime.. I think if you get the batch sizes up it gets close, but at batch size 1 for real-time PyTorch is awful. Depthwise separable convs impact train and inference alike on GPU. The path to impr…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jp7c5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants