tfjs: TFJS does not work with converted CenterNet models

CenterNet model works when loaded as saved_model in tfjs_node using loadSavedModel(), but fails when converted using tensorflowjs_converter --input_format tf_hub ... to graph_model
it seems to convert correctly and loads correctly using loadGraphModel, but fails during call to executeAsync():

Uncaught (in promise) Error: All tensors passed to tf.addN() must have the same shape
  (anonymous)	@	add_n.js:48
  addN_	@	add_n.js:46
  addN__op	@	operation.js:44
  executeOp	@	arithmetic_executor.js:28
  (anonymous)	@	operation_executor.js:48
  (anonymous)	@	engine.js:314
  scopedRun	@	engine.js:324
  tidy	@	engine.js:313
  tidy	@	globals.js:173
  (anonymous)	@	operation_executor.js:48
  executeOp$h	@	operation_executor.js:90
  processStack	@	graph_executor.js:390
  executeWithControlFlow	@	graph_executor.js:350

this is a new error message as code changes from #4100 do fix previously encountered error (see #3903 for details), but it seems it’s like peeling an onion 😃

environment: tfjs built from master dated 10/24/2020 on ubuntu 20.10

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

@sandhyacs

i didn’t get that error

wget https://tfhub.dev/tensorflow/centernet/resnet50v2_512x512_kpts/1?tf-hub-format=compressed
tar xzf 1\?tf-hub-format\=compressed
rm 1\?tf-hub-format\=compressed
tensorflowjs_converter --input_format=tf_saved_model --output_format=tfjs_graph_model . graph

it throws some warnings as variables are not constant, but conversion finishes without errors and model is usable