Hi all, I was following this tutorial below, and tried converting the saved model (tf SavedModel) to TensorflowJS format (model.json) using tensorflow_converter. Reason I am doing this rather than running MobileBERT directly from tfhub on TensorflowJS is because I plan to train this model on my own dataset.
The conversion works, and I loaded my converted in Javascript using tf.loadGraphModel. However doing so I am met with an error “TypeError: Cannot read property ‘producer’ of undefined" on browser console”. I did my Googling and found out it was due to the usage of Functional apis. Some said using tf.loadLayersModel work, but when I tried it gave me error saying “could be due to the Keras Functional api usage”.
Any ideas how I can convert that to be runnable on browser? I am not too sure how I can change the Functional api usage to Sequential etc as I am pretty new to it.
Welcome to the community and thanks for posting your question. Let me check and get back to you what may be causing this. In the meantime do you have your code hosted anywhere so we can replicate the error and inspect it eg Glitch.com or Codepen.io?
Most welcome and good luck with your future hacking! Look forward to seeing your future creations - do share with us what you end up making if you are able