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
How to get trained model in keras format instead of saved model? #64
Comments
I successfully converted the saved_model format of basic pitch to onnx format using tf2onnx. You could try to further convert this onnx model to keras using onnx2keras. |
On my side, I managed to apply the weights of the tfjs model (model used in the basic-pitch website) to the keras model (created with Converting to ONNX definitely helps, but I don't think you'll get the same structure for the keras model as the one you get when you create the keras model using All those issues would be solved if the model was saved directly with the keras API after training, but I don't know if it is that easy to do once the model is trained and saved as a |
Agree, amazing for sure! @DamRsn very cool plugin too!! Another vote for getting some kind of more usable model format. Any assistance would be appreciated with this |
Thanks for this amazing work!
I'm currently working on integrating basic-pitch in an audio plugin. For that, I would need to have the trained basic pitch model as a Keras model in order to convert it into the format that I'm going to use in C++ for inference.
Unfortunately, the ICASSP2022 model is saved as a tensorflow saved_model, even though it is originally a keras model that can be built with the
model()
function frommodel.py
.I tried to transfer the weights from the trained model to an untrained keras model but I did not find a straightforward way to do it.
I could gather all the layers' weights manually from the saved_model and apply them one by one to an untrained keras model created with
model()
, but before getting there: do you have a trained keras model that you could share? Or do you know a way to get it from the trained tensorflow saved_model?Also, similar to #62 , is there a more recent model I could use, perhaps the one used in the basic-pitch-ts repo for https://basicpitch.spotify.com/ ?
Thanks for your help!
The text was updated successfully, but these errors were encountered: