Closed tinoucas closed 4 years ago
Hi @tinoucas and sorry for the delay. I'm not much available lately.
To check how I use that script, you should take a look at the add_spleeter.cmake file.
If you don't want to bother with the export, I also uploaded deezer's checkpoints model after conversion right here.
Hope this helps !
Hi @gvne
That's what I started with: read the cmake to find out how to use it.
Nevertheless, I managed to export it without this script:
Using tf.compat.v1.saved_model.builder.SavedModelBuilder
and add_meta_graph_and_variables
, and recreating the signature manually.
Also, this method does not require the spleeter package.
BTW: my goal was to convert it to TensorFlow-lite, and it works! 😃 (the models you exported caused errors with the converter: audio_id
had no shape)
Great to see you found another way.
Happy coding !
@tinoucas Please i have been looking fo how to export the models to tflite and i would gladly appreciate if you can assist me on how you achieved that.
Hi @gvne That's what I started with: read the cmake to find out how to use it. Nevertheless, I managed to export it without this script: Using
tf.compat.v1.saved_model.builder.SavedModelBuilder
andadd_meta_graph_and_variables
, and recreating the signature manually. Also, this method does not require the spleeter package. BTW: my goal was to convert it to TensorFlow-lite, and it works! 😃 (the models you exported caused errors with the converter:audio_id
had no shape)
Wow do you think you could share this?
I have been trying to get spleeter to run on mobile (iOS) by using going back to the correct version of tensorflow 1.x and trying to rebuild it for iOS with the correct operations/kernals added. After I got all that done I realised a bunch of the bundle loading methods have not been implemented for that platform -_- in this older version.
For all those wondering, I've put my scripts and some info for this in a new repo here: spleeter-tflite-convert
Your link looks correct but when you click on it - it navigates to the wrong page.
^^ Correct link
Also thanks very much! Can't wait to check this out :D.
Sorry about that (I fixed the link)
For all those wondering, I've put my scripts and some info for this in a new repo here: spleeter-tflite-convert
Thank you very much for your support @tinoucas.
For those looking for pre-converted binaries, they can download this consist of all the models (2stems, 4stems and 5stems - SavedModel + TFLite) - Generated based on the scripts provided by @tinoucas and official checkpoints provided by deezer/spleeter
Thanks @jinay1991 for your help. I am implementing this model in an android app. What are the audio pre-processing I need to do to the input audio file (mp3) before passing to the tflite interpreter. And also what are the post-processing I need to do to the output
@tinoucas do you know how you can convert the saved models to tfjs graph model? I tried using the tensorflowjs_converter and it throws an error "ValueError: index can't contain negative values" with those saved models.
Hi,
I'm trying to export a saved model from a checkpoint (4stems from deezer/spleeter) with this export_spleeter_models.py (from cmake/ directory). But I end up with the following output tensors:
Everything is wrong: type/dimensions/name... Eventhough, the spleeter checkpoint version from github match (v1.4.0)
I only managed to launch this script with python 3.7 on macOS (the only version of python I found with both spleeter and tensorflow 1.15.2, through pip)
Any clue what might be the cause? How did you do it?