Submitted by CodaholicCorgi t3_z50vvq in MachineLearning
Deep-Station-1746 t1_ixu6ych wrote
Reply to comment by Background_Thanks604 in [D] Pytorch or TensorFlow for development and deployment? by CodaholicCorgi
Load pt model with torch, get all weights with state_dict
. Make them all into channels last format with permute
. Load all the arrays into numpy. Load all the arrays into tensorflow. Write the network forward logic in tensorflow. Plug in weights. Run.
Background_Thanks604 t1_ixuccby wrote
Thanks for clearification! Do you know if there is an tutorial/blog post for this approach?
Deep-Station-1746 t1_ixugp6t wrote
Nope. I don't think so. If you need help and are willing to wait a bit (A bit busy right now), DM me and I'll take a look at your problem.
Background_Thanks604 t1_ixukvcg wrote
Thx - appreciate it! I dont have a problem i just want to learn/try this approach because i never heard of it.
jobeta t1_ixum5yx wrote
How complex is the model you want to translate?
Background_Thanks604 t1_ixun76x wrote
I dont have a model to translate - i read about this approach in the comments and i want to learn about it.
ApeForHire t1_ixwveuz wrote
I was actually able to do this once by relying heavily on Github's Copilot, ie just giving functions very specific names and commenting things like "this function converts a pytorch model into a vector of weights" etc. It worked pretty well and was simple for basic network architectures, though I imagine it could get more complicated.
Mefaso t1_iy26yec wrote
https://github.com/lernapparat/lernapparat/blob/master/style_gan/pytorch_style_gan.ipynb
This notebook does the reverse - TF to torch for stylegan
Viewing a single comment thread. View all comments