Created
November 15, 2020 15:42
-
-
Save aniketbiprojit/3921597e22c49c8338931bc4b24e9ff8 to your computer and use it in GitHub Desktop.
Convert all tfjs-models to Keras h5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { exec } = require('child_process') | |
const fs = require('fs') | |
model_dirs = fs.readdirSync(`${__dirname}/tfjs-models`) | |
if (!fs.existsSync('keras_models')) fs.mkdirSync('keras_models') | |
model_dirs.forEach((dir) => { | |
exec( | |
`tensorflowjs_converter --input_format tfjs_layers_model tfjs-models/${dir}/model.json keras_models/${dir}.h5 --output_format keras_saved_model` | |
) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment