Hello, recently I encountered the following bug when using Algorithm.export_policy_model():
WARNING tf_policy.py:646 -- Could not save keras model under self[TfPolicy].model.base_model!
This is either due to ..
a) .. this Policy's ModelV2 not having any `base_model` (tf.keras.Model) property
b) .. the ModelV2's `base_model` not being used by the Algorithm and thus its
variables not being properly initialized.
I found out that this problem happens when the model configuration 'free_log_std': True is set.
The following log was shown when I run_experiment with that configuration included:
WARNING:tensorflow:
The following Variables were used a Lambda layer's call (lambda), but
are not present in its tracked objects:
<tf.Variable 'default_policy/log_std:0' shape=(1,) dtype=float32>
It is possible that this is intended behavior, but it is more likely
an omission. This is a strong indication that this layer should be
formulated as a subclassed Layer rather than a Lambda layer.
This problem disappeared when I set 'free_log_std': False.
Is there any solution if I want to set 'free_log_std': True and able to export_policy_model() successfully?This is crucial as I need the exported model for TensorFlow Serving.
Versions / Dependencies
Ray 2.3.0
TF 2.11.0
Python 3.10
Reproduction script
Run the following python script (e.g., on Notebook) for reproduction:
What happened + What you expected to happen
Hello, recently I encountered the following bug when using
Algorithm.export_policy_model()
:I found out that this problem happens when the model configuration
'free_log_std': True
is set. The following log was shown when Irun_experiment
with that configuration included:This problem disappeared when I set
'free_log_std': False
.Is there any solution if I want to set
'free_log_std': True
and able toexport_policy_model()
successfully? This is crucial as I need the exported model for TensorFlow Serving.Versions / Dependencies
Ray 2.3.0 TF 2.11.0 Python 3.10
Reproduction script
Run the following python script (e.g., on Notebook) for reproduction:
Issue Severity
High: It blocks me from completing my task.