-
Notifications
You must be signed in to change notification settings - Fork 728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using loaded trained model #244
Comments
Policies expect batched time_steps, eex. So make sure to wrap the eval_env with |
I added the line:
and got the error:
But my problem persists as I intend to use the trained agent receiving entries from the real world, not from the simulated environment I use to train it faster. |
I am getting a similar error when I tried to load a model that used an RNN model, but not when I use the feedforward model #246. |
I am getting a similar issue, does anyone know of a workaround for saving and loading a policy with tf_agents? |
When I tried to convert a TF 2.8 pb file to TF 1.15, the same error came to me. Could you help me please? Here is the code: =========================code start=============================== import os ## tf22_saved_model_to_tf115_pb.py TF2_model_input = 'CLIP_RN50' # the input path model = tf.keras.models.load_model(TF2_model_input) # read the model ckpt in TF2.8 full_model = tf.function(lambda x,y: model(x,y)) # change the model to concrete function frozen_func = convert_variables_to_constants_v2(full_model) # change the model parameters to constants frozen_func.graph.as_graph_def() # change the model graph to graph def layers = [op.name for op in frozen_func.graph.get_operations()] # debug, check the parameters and parameter names (needed in TF1.15) tf.io.write_graph(graph_or_graph_def=frozen_func.graph, =========================code end=============================== =========================Error start ================================
=========================Error end ================================ |
I am training and saving a PPO agent as in https://github.com/tensorflow/agents/blob/master/tf_agents/agents/ppo/examples/v2/train_eval.py
The code used is:
After training I am trying to load and use the model as in:
I am getting the following error:
The text was updated successfully, but these errors were encountered: