GithubHelp home page GithubHelp logo

Comments (3)

gyccccccccc avatar gyccccccccc commented on May 27, 2024

It's the "D:\py_learning\MARLlib-master\marllib\envs\base_env\exp_results\mappo_mlp_multimerge\MAPPOTrainer_my_merge_multimerge_00c80_00000_0_2023-12-13_18-40-16\params.json"

{
"batch_mode": "truncate_episodes",
"clip_param": 0.3,
"entropy_coeff": 0.01,
"env": "my_merge_multimerge",
"evaluation_interval": 50,
"framework": "torch",
"kl_coeff": 0.2,
"lambda": 1.0,
"lr": 0.0005,
"model": {
"custom_model": "Centralized_Critic_Model",
"custom_model_config": {
"agent_level_batch_update": false,
"agent_name_ls": [
"vehicle1",
"vehicle2"
],
"algorithm": "mappo",
"checkpoint_end": true,
"checkpoint_freq": 50,
"env": "my_merge",
"env_args": {
"map_name": "multimerge"
},
"episode_limit": 100,
"evaluation_interval": 50,
"force_coop": false,
"framework": "torch",
"global_state_flag": true,
"local_dir": "",
"local_mode": true,
"mask_flag": false,
"model_arch_args": {
"core_arch": "mlp",
"encode_layer": "128-128",
"fc_layer": 2,
"hidden_state_size": 256,
"out_dim_fc_0": 128,
"out_dim_fc_1": 64
},
"num_agents": 2,
"num_cpus_per_worker": 1,
"num_gpus": 1,
"num_gpus_per_worker": 0,
"num_workers": 2,
"opp_action_in_cc": true,
"policy_mapping_info": {
"multimerge": {
"all_agents_one_policy": true,
"description": "multi agents merge",
"one_agent_one_policy": true,
"team_prefix": "vehicle_"
}
},
"restore_path": {
"model_path": "",
"params_path": ""
},
"seed": 321,
"share_policy": "all",
"space_act": "Discrete(5)",
"space_obs": "Dict(obs:Box([-inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf\n -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf], [inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf\n inf inf inf inf inf inf inf], (25,), float32))",
"stop_iters": 9999999,
"stop_reward": 999999,
"stop_timesteps": 2000000
}
},
"multiagent": {
"policies": "{'shared_policy'}",
"policy_mapping_fn": "<function run_cc.. at 0x0000023968971700>"
},
"num_gpus": 1,
"num_gpus_per_worker": 0,
"num_sgd_iter": 5,
"num_workers": 2,
"seed": 321,
"sgd_minibatch_size": 1000,
"simple_optimizer": false,
"train_batch_size": 1000,
"use_gae": true,
"vf_clip_param": 10.0,
"vf_loss_coeff": 1.0
}

from marllib.

Aequatio-Space avatar Aequatio-Space commented on May 27, 2024

The actual error is in the front:

raise ValueError(
ValueError: action_space not provided in PolicySpec for shared_policy and env does not have an action space OR no spaces received from other workers' env(s) OR no action_space specified in config.

It seems that you didn't specify action_space in your environment. You can set relevant properties in custom environment wrapper like:

class RLlibMAGym(MultiAgentEnv):
def __init__(self, env_config):
map = env_config["map_name"]
env_config.pop("map_name", None)
self.env = REGISTRY[map](**env_config)
# assume all agent same action/obs space
self.action_space = self.env.action_space[0]
self.observation_space = GymDict({"obs": Box(
low=0.0,
high=1.0,
shape=(self.env.observation_space[0].shape[0],),
dtype=np.dtype("float64"))})

Or somehow through the configuration file. I set these properties directly through environment code.

from marllib.

gyccccccccc avatar gyccccccccc commented on May 27, 2024

Thank you for your answer :)

from marllib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.