简体   繁体   中英

alternative to tf_frozen_model in tensorflowjs_converter

I am new to tensorflow and installed the current tensorflowjs(1.1.2) through pip, since I want to convert a frozen inference graph ( .pb ) to a tensorflowjs file ( --output_format=tensorflowjs ). I followed a tutorial where --input_format=tf_frozen_model is suggested, this version of tensorflowjs, however is not supporting such option anymore and returns an error message error:argument --input_format: invalid choice: 'tf_frozen_model' . Has this option been replaced completely, or only renamed? I tried to install version tensorflowjs v.0.8.0 , which resulted in a bunch of ImportErrors (for Keras) and dependency conflicts. Do I miss something here?

  1. create a new virtual environment and install tensorflowjs 0.8.6 using command: pip install tensorflowjs==0.8.6
  2. further model can be converted using: tensorflowjs_converter --input_format=tf_frozen_model --output_json=true --output_node_names='MobilenetV1/Predictions/Reshape_1' --saved_model_tags=serve \\ /mobilenet/frozen_model.pb /mobilenet/web_model
  3. refer: https://github.com/tensorflow/tfjs-converter

Modern versions of the tensorflowjs package no longer convert from frozen models . From https://github.com/tensorflow/tfjs-converter :

Note: If you want to convert TensorFlow frozen model or session bundle, you can install older versions of the tensorflowjs pip package, ie pip install tensorflowjs==0.8.6

. Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM