How to load SlicingOpLambda and TFOpLambda Layer in tfjs?

I’m trying to train a custom model for pose detection using MoveNet. For that, I need to normalise the landmarks or key points of the training data. The Keras and tf functions which are being used in python for normalizing are working fine but when I am loading that model in tfjs, the model is giving errors stating SlicingOpLambda and TFOpLambda Layer is undefined. If someone can help with this, please do.

Check Strided slice implementation leads to negative tensor dimension · Issue #4853 · tensorflow/tfjs · GitHub

Hi Aseem,

I’m facing the same issue and I wonder if you found a solution to this problem.

I was talking to one of our SWEs on the team and they suggested for you to try converting your layers model to a graph model first with the TensorFlow.js converter.

Check this documentation here:

In this situation you could use --input_format keras and then set the --output_format tfjs_graph_model as frozen model should be suitable for inference in browser as you do not need to retain in the browser.

Let me know if that helps!