Hi , I am trying to use pre-trained tf saved model to generate web friendly model . The models are situated in contrib/tf_serving/tfs_models folder .
I have successfully converted the model using tensorflowjs_converter . and the generated format is graph model . I have tried to use this model for prediction but I am facing below error :
Error: Operands could not be broadcast together with shapes 1,112,112,32 and 0.
at Co (tf-core.esm.js?45ef:17)
at new ka (tf-core.esm.js?45ef:17)
at o.batchNormalization (tf-core.esm.js?45ef:17)
at eval (tf-core.esm.js?45ef:17)
at eval (tf-core.esm.js?45ef:17)
at eval (tf-core.esm.js?45ef:17)
at t.scopedRun (tf-core.esm.js?45ef:17)
at t.tidy (tf-core.esm.js?45ef:17)
at f (tf-core.esm.js?45ef:17)
at eval (tf-core.esm.js?45ef:17)
Here is the step followed :
Converted TF saved model to Web model :
tensorflowjs_converter \
--input_format=tf_saved_model \
--output_format=tfjs_graph_model \
--signature_name=image_quality\
--saved_model_tags=serve \
<saved model Location> \
<web model location>
Loaded Model using tfjs :
const model = await tf.loadGraphModel(assets/models/aesthetic/model.json)
Hi , I am trying to use pre-trained tf saved model to generate web friendly model . The models are situated in contrib/tf_serving/tfs_models folder .
I have successfully converted the model using tensorflowjs_converter . and the generated format is graph model . I have tried to use this model for prediction but I am facing below error :
Here is the step followed :
Converted TF saved model to Web model :
Loaded Model using tfjs :
const model = await tf.loadGraphModel(assets/models/aesthetic/model.json)
prediction Function :
Please help !