Tfjs: tensorflowjs_converter cannot convert body-pix model to Keras .h5

Created on 24 Feb 2019  路  7Comments  路  Source: tensorflow/tfjs

To get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

TensorFlow.js version

tensorflowjs 0.8.0
Dependency versions:
keras 2.2.2
tensorflow 1.12.0

Browser version

N/A

Describe the problem or feature request

tensorflowjs_converter cannot convert body-pix model to Keras

Code to reproduce the bug / link to feature request

I have the following files from the body-pix model gathered:

  • tensorflowjs_model.pb
  • weights_manifest.json
  • group1-shard1of1

But running:
tensorflowjs_converter --input_format=tensorflowjs --output_format=keras ./input/weights_manifest.json ./output/model.h5
returns the error:
The JSON content is required to be adict, but found <class 'list'>.

There does not appear to be a model.json file associated with the body-pix example since this link returns a 404 unlike other models. Is it possible to generate a model.json file with tensorflowjs_model.pb and weights_manifest.json? Or is it possible to run tensorflowjs_converter without model.json?

Most helpful comment

@pyu10055 Thank you for your response.
Is the body-pix training dataset published in public?
I would like to use body-pix by python..

All 7 comments

body-pix is converted from a TensorFlow SavedModel, not a keras or TensorFlow.js model. So it can't be converted to a keras model.

so is it possible to turn it back to a tensorflow saved model? Or export the model to something other than tensorflow.js?

@pyu10055 Is it possible to transform a tensorflowjs-format frozen model into a tensorflow SavedModel currently?

@caisq @pyu10055 @sam598

Is it possible to transform a tensorflowjs-format frozen model into a tensorflow SavedModel ?

Is there anyone who knows the answer to this question?

@caisq @kidapu It is not possible right now to reverse the conversion of tfjs graph model to TF saved model.

@pyu10055 Thank you for your response.
Is the body-pix training dataset published in public?
I would like to use body-pix by python..

Here you go https://github.com/ajaichemmanam/posenetv2-pythontf
You can work upon this to create bodypix version

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nsthorat picture nsthorat  路  3Comments

tpreusse picture tpreusse  路  4Comments

weiji14 picture weiji14  路  3Comments

chrisdonahue picture chrisdonahue  路  3Comments

pranayaryal picture pranayaryal  路  4Comments