I'm trying to pass time_step into the policy for inference, but it raises the following error:
InvalidArgumentError (note: full exception trace is shown but execution is paused at: _run_module_as_main)
Graph execution error:
Detected at node 'transformer_network_1/Reshape_7' defined at (most recent call last):
Node: 'transformer_network_1/Reshape_7'
Input to reshape is a tensor with 0 values, but the requested shape has 1
[[{{node transformer_network_1/Reshape_7}}]] [Op:__inference_restored_function_body_123572]
File "/home/robot/miniconda3/envs/rt1/lib/python3.10/site-packages/tensorflow/python/eager/execute.py", line 53, in quick_execute
The code I am using is attached below and I would like to know how to use the model provided. The format of the TimeStep object is defined with reference to the time_step_spec of the loaded policy.
After load model with policy = tf.saved_model.load("path") and policy_state = policy.get_initial_state(1), the previous code works for me. I'm using tensorflow 2.13 and tf-agents 0.17
I'm trying to pass
time_step
into the policy for inference, but it raises the following error:The code I am using is attached below and I would like to know how to use the model provided. The format of the TimeStep object is defined with reference to the time_step_spec of the loaded policy.