Skip to content
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

only single action supported #112

Open
mattinjersey opened this issue May 17, 2019 · 7 comments
Open

only single action supported #112

mattinjersey opened this issue May 17, 2019 · 7 comments

Comments

@mattinjersey
Copy link

Getting this error...is this my mistake or do some agents only support a single action?

ValueError: Only a single action is supported by this network
In call to configurable 'CriticNetwork' (<function _NetworkMeta.new..capture_init at 0x00000203ED9DEEA0>)
In call to configurable 'train_eval' (<function train_eval at 0x00000203EE878BF8>)

@sguada
Copy link
Member

sguada commented May 20, 2019

You need to define a network that can support multiple Actions, you can use CriticNetwork as an example.

@mattinjersey
Copy link
Author

Well for example with td3 agent, I define Critic Network as follows, and the action spec defined with 2 actions, and I get such error. The only agent that worked was PPOAgent.
Are we sure that all the agents can handle multiple actions?

_critic_net_input_specs = (tf_env.time_step_spec().observation,
tf_env.action_spec())

critic_net = critic_network.CriticNetwork(
    critic_net_input_specs,
    observation_fc_layer_params=critic_obs_fc_layers,
    action_fc_layer_params=critic_action_fc_layers,
    joint_fc_layer_params=critic_joint_fc_layers,
)_

@mattinjersey
Copy link
Author

Right, I see in ddpg that critic_network can only handle 1 observation.
So it seems like ddpg agent is limited to 1 observation.

@mattinjersey
Copy link
Author

SAC only limited to 1 observation, it appears.

@sguada
Copy link
Member

sguada commented May 21, 2019

So would need to write your own ActorNetwork and your own CriticNetwork classes that can handle multiple observations and multiple actions.

@mattinjersey
Copy link
Author

ok I may try it. I'm not sure why the PPO Agent is written so that it can accept arbitrary number of actions/observations but the CriticNetwork is written differently.

@basvanopheusden
Copy link

I am also struggling with the same issue, @sguada, if you could give me some pointers as to how to create custom ActorDistributionNetworks, I would really appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants