diff --git a/docs/concepts.md b/docs/concepts.md index d1485a5b6..2c1f3ed85 100644 --- a/docs/concepts.md +++ b/docs/concepts.md @@ -85,6 +85,14 @@ A *quantum neural network* (QNN) is used to describe a parameterized quantum computational model that is best executed on a quantum computer. This term is often interchangeable with *parameterized quantum circuit* (PQC). +#### Saving models + +Note: `model.save()` does not work for TensorFlow Quantum models containing +custom quantum layers, because full model serialization requires the layer +to be reconstructable without the original Python code. Instead, use +`model.save_weights()` to save the trained parameters, then rebuild the model +architecture in Python and restore them with `model.load_weights()`. + ## Research diff --git a/scripts/ci_validate_tutorials.sh b/scripts/ci_validate_tutorials.sh index 247ba899b..feff4c798 100755 --- a/scripts/ci_validate_tutorials.sh +++ b/scripts/ci_validate_tutorials.sh @@ -32,6 +32,9 @@ pip install gymnasium[classic-control]==1.2.3 pip install seaborn==0.12.0 # tf_docs pip package needed for noise tutorial. pip install -q git+https://github.com/tensorflow/docs +# pydot and graphviz needed for tf.keras.utils.plot_model in tutorials +pip install pydot +sudo apt-get install -y graphviz # Leave the quantum directory, otherwise errors may occur cd ..