1

Trying to convert a simple CNN using tfjs. The model gets converted, however it does not get loaded in properly. Error: 'An InputLayer should be passed either a batchInputShape or an inputShape.'

tf.saved_model.save(model, 'my_model')

import tensorflowjs as tfjs
tfjs.converters.save_keras_model(model, 'tfjs')

I have tried converting the model from both .h5 and .keras formats. Sometimes I get a different error on the model configuration. A few months ago I converted some similar models and never had any problems. Anyone got an idea?

1
  • This issue can occur due to various reasons, especially if the model is not defined with an explicit shape for the input layer or if there are compatibility issues between TensorFlow/Keras model and tensorflowjs. To fix this, make sure model has a defined input shape and ensure you are using compatible versions. Commented Jan 10 at 8:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.