-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quick Question on Transferring Model Weights #8382
Comments
Hi @TheRealCasmat , TFJS and tensorflow use distinct weight formats. In tfjs, weights are represented as Thank you!! |
Hey @shmishra99! Yes, they’re different formats, but how do I convert the formats? Thanks! |
Hey! Any ideas? Thanks! |
HI @TheRealCasmat , Apologies for the delayed response. In While the Thank You!! |
Hey @shmishra99! No worries, I was trying to work out the logic of the conversion, but I couldn’t completely nail it down and was wondering if you’d be able to help. Here’s what I had so far: In my react frontend using axios:
Flask backend:
Thanks! |
Hi @TheRealCasmat , I was trying to convert the Thank You!! |
Hey @shmishra99! Yeah that wouldn’t be ideal, I was trying to implement federated learning so only the modified weights of a users local model would be sent to a global model and updated there. If the tfjs converter is able to convert the models to keras, wouldn’t some code in the repo manage the weight conversion itself? I couldn’t find anything on it however.. Thanks! |
Any Ideas? |
Hey!
In the TFJS API, there is a
getWeights()
fcn that returns a tensor containing the weights of the model. I tried converting this tensor into a json and send that to a python server containing TensorFlow and tried loading the weights, but I was unable to get the format of the weights to work. Any idea how I am able to transfer model weights from TFJS to TF?Thanks!
The text was updated successfully, but these errors were encountered: