damccorm commented on code in PR #26472:
URL: https://github.com/apache/beam/pull/26472#discussion_r1180646421
##########
examples/notebooks/beam-ml/run_inference_tensorflow.ipynb:
##########
@@ -356,7 +332,7 @@
{
"cell_type": "markdown",
"source": [
- "Save the weights."
+ "Instead of saving the entire model, you can just save the model
weights for inference. This is slightly lightweight than saving and loading the
entire model. However, you need to pass the function to build TensorFlow model
to the `TFModelHandlerNumpy` / `TFModelHandlerTensor` class along with
`ModelType.SAVED_WEIGHTS`."
Review Comment:
```suggestion
"Instead of saving the entire model, you can just [save the model
weights for
inference](https://www.tensorflow.org/guide/keras/save_and_serialize#saving_loading_only_the_models_weights_values).
This creates a smaller artifact than saving and loading the entire model and
allows the model to be more easily loaded on different architectures. However,
to load the model you will need to pass the function to build TensorFlow model
to the `TFModelHandlerNumpy` / `TFModelHandlerTensor` class along with
`ModelType.SAVED_WEIGHTS`."
```
Rethinking this, I actually think providing a little more guidance on why
you might do this is helpful. Also, some wording nits
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]