Hello MasterScrat,
I am a bit confused by the way DDDQN accepts a Namespace within the policy:
policy = DDDQNPolicy(state_size, action_size, Namespace(**parameters), evaluation_mode=True)
Namespace is formed by this:
env_params_dict = {
# sample configuration
"n_agents": 5,
"x_dim": 35,
"y_dim": 35,
"n_cities": 4,
"max_rails_between_cities": 2,
"max_rails_in_city": 3,
"seed": 42,
"observation_tree_depth": 2,
"observation_radius": 10,
"observation_max_path_depth": 30
}
env_params = Namespace(**env_params_dict)
I am confused about two things.
1-While evaluating using run.py the environment variables will change from what I understand according to the environment which was created for the agent to be evaluated in. How should I approach this to be able to test the example Multi-agent?
2- When I run run.py with redis as a local test. I get the following error:
File “run.py”, line 162, in
action = my_controller(observation, number_of_agents)
File “run.py”, line 68, in my_controller
_action[_idx] = policy.act(observation, eps=0.0)
File “/mnt/c/Users/nvda/Desktop/AI_2/NeurIPS_flatland/neurips2020-flatland-starter-kit/reinforcement_learning/dddqn_policy.py”, line 56, in act
state = torch.from_numpy(state).float().unsqueeze(0).to(self.device)
TypeError: expected np.ndarray (got dict)
If you can give me any pointers about how to proceed, It would be of great help.
thank you
PS:
my controller is set up like this:
def my_controller(obs, number_of_agents):
_action = {}
print(_action)
for _idx in range(number_of_agents):
_action[_idx] = policy.act(observation, eps=0.0)
print(_action)
return _action