Questions tagged [tf-agent]
43 questions
0
votes
1 answer
tf_agents and reverb produce incompatible tensor
I'm trying to implement a DDPG using tf_agents and reverb but I can't figure out how both libraries to work together. For this, I'm trying to use the code from the DQL-Tutorial from tf_agents with my own agent and gym environment. The error occurs…

RobinW
- 292
- 4
- 16
0
votes
1 answer
Issues importing with tf-agents[reverb] for building a DQN in tensorflow
I am trying to get my environment setup to train a deep Q network with TF-Agents. However, I'm getting a bunch of import errors that I can't seem to resolve. The tutorial I am following, here, required the following…
0
votes
0 answers
Proper object type to pass in as time_step_spec to tf-agent?
I'm trying to pass in a BoundedArraySpec as time_step_spec
tf_agents.agents.DqnAgent(
time_step_spec = tf_agents.specs.BoundedArraySpec(...
but ultimately, I get this error
AttributeError: 'BoundedArraySpec' object has no attribute…

tgm_learn
- 61
- 7
0
votes
1 answer
tf_agents dqn fails to initialize
Even though tf.agents initialize() require no input variables, this line
agent.initialize()
produces this error
TypeError: initialize() missing 1 required positional argument: 'self'
Ive tried agent.initialize(agent) because it apparently wanted…

tgm_learn
- 61
- 7
0
votes
0 answers
InvalidArgumentError: cannot compute MatMul as input #1(zero-based) was expected to be a int32 tensor but is a float tensor [Op:MatMul]
I'm trying to apply the Tensorflow PPO agent to the card game environment (can be found in the "Environments" Tensoflow guide page).
And I defined actor network, value network, and PPO agent as below.
def create_networks(tf_env):
actor_net =…

Tro
- 1
- 1
0
votes
0 answers
ValueError: Input 0 of layer bias_layer is incompatiblewith the layer: : expected min_ndim=2, found ndim=1. Full shape received: [0]
I'm trying to apply Tensorflow PPO Agent to a biopedal robot model to learn walking.
I suppose the input, which I suppose is the observation_spec, has 12 dimensions but I don't know why ndim is found to be 1. Am I missing something..?
class…

Tro
- 1
- 1
0
votes
1 answer
inheritted method from PyEnvironment causes error because underscore at start of function name
i get the error below.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Input In [3], in ()
27 def… |

tgm_learn
- 61
- 7
0
votes
1 answer
Problem with input shape of Conv1d in tfagents sequential network
I have created a trading environment using tfagent
env = TradingEnv(df=df.head(100000), lkb=1000)
tf_env = tf_py_environment.TFPyEnvironment(env)
and passed a df of 100000 rows from which only closing prices are used which a numpy array of 100000…

AB Music Box
- 81
- 1
- 6
0
votes
1 answer
How to use the replay buffer in tf_agents for contextual bandit, that predicts and trains on a daily basis
I am using the tf_Agents library for contextual bandits usecase.
In this usecase predictions (daily range between 20k and 30k predictions, 1 for each user) are made daily (multiple times a day) and training only happens on all the predicted data…

tjt
- 620
- 2
- 7
- 17
0
votes
1 answer
TF-Agents TypeError: The two structures do not match, next_step_type, policy_info
Hi and thank you in advance,
I'm trying to get to run a custom environment in tf-agents and getting the following
TypeError: The two structures do not match:
Trajectory(
{'action': .,
'discount': .,
'next_step_type': .,
'observation':…

Chris_S
- 11
- 1
- 2
0
votes
1 answer
TFAGENTS: clarification on the usage of observation_and_action_constraint_splitter for DqnAgent agents
im trying to create a DqnAgent agent with a mask for valid/invalid actions, according to this post
, i should specify a splitter_fn for the observation_and_action_constraint_splitter arg. According to the tf_agents doc
, the splitter_fn would be…

John
- 309
- 3
- 12
0
votes
0 answers
Tensorflow gives unexpected keyword argument 'blacklist' error
This code was running well in Ubuntu using conda. Then I had to move to a windows environment where I tried to create a similar conda environment. When I try running it, the error message is
Traceback (most recent call last):
File…

user3656142
- 437
- 3
- 14
-1
votes
1 answer
Failed to import from tf_agents.agents.categorical_dqn import categorical_dqn_agent
Im getting this error when importing this command on python
from tf_agents.agents.categorical_dqn import categorical_dqn_agent
Traceback (most recent call last):
File "", line 1, in
from tf_agents.agents.categorical_dqn…

KASUN PRABHATH
- 3
- 2