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.
https://www.tensorflow.org/text/tutorials/classify_text_with_bert 6
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.