问题
I want to convert a model and its respective trained weights from tensorflow.js to standard tensorflow, but cant quite figure out how to do it, the documentation of tensorflow.js dont say anything about this
I have a manifest.json and a lot of other files corresponding to the weights and bias of every layer, I want to get a .bytes file, to be used in the standard version of tensorflow
I checked the answers to other question that might be mildly related How to download models and weights from tensorflow.js (I asked that question) which was only partially answered, answer that doesnt give any hints regarding this one
回答1:
Tensorflow.js converter can convert the tfjs model into Keras HDF5 format with following params:
tensorflowjs_converter --input_format=tfjs_layers_model --output_format=keras path/to/tfjs_files path/to/save_keras_hdf5
You can take a look here for installing the converting. Once the model is converted to Keras HDF5 you can convert it the TensorFlow SavedModel format. So, this thread might be helpful.
来源:https://stackoverflow.com/questions/54242701/how-to-convert-tensorflow-js-model-and-weights-to-standard-tensorflow