From 95f55a37a2d48b2712db7f146a1e46f93487c312 Mon Sep 17 00:00:00 2001 From: Aman Maghan <104973175+a-maghan@users.noreply.github.com> Date: Thu, 8 Dec 2022 17:12:25 +0530 Subject: [PATCH] Update README.md name_policy is the correct_argument. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 400cc45..000718c 100644 --- a/README.md +++ b/README.md @@ -30,14 +30,14 @@ To use the converter properly, please, make changes in your `~/.keras/keras.json ## Tensorflow.js -For the proper conversion to a tensorflow.js format, please use the new flag `names='short'`. +For the proper conversion to a tensorflow.js format, please use the new flag `name_policy='short'`. Here is a short instruction how to get a tensorflow.js model: 1. First of all, you have to convert your model to Keras with this converter: ```python -k_model = pytorch_to_keras(model, input_var, [(10, 32, 32,)], verbose=True, names='short') +k_model = pytorch_to_keras(model, input_var, [(10, 32, 32,)], verbose=True, name_policy='short') ``` 2. Now you have Keras model. You can save it as h5 file and then convert it with `tensorflowjs_converter` but it doesn't work sometimes. As alternative, you may get Tensorflow Graph and save it as a frozen model: