neuralmmo / baselines Goto Github PK
View Code? Open in Web Editor NEWBaselines for Neural MMO -- new users should treat this repo as a starter project
License: MIT License
Baselines for Neural MMO -- new users should treat this repo as a starter project
License: MIT License
At https://neuralmmo.github.io/build/html/rst/baselines.html the suggest that you could change "scale".
But trying the suggested commandline:
python main.py train --config=baselines.Medium --scale=Baseline --RESTORE=None
You are just getting the error:
AssertionError: CLI argument: scale is not a Config property
My guess is that it happens because the order of the commands.
If you take a look at https://github.com/NeuralMMO/baselines/blob/main/main.py#L188
Those lines should probably be placed before:
config = attrgetter(config)(base_config)()
config.override(**kwargs)
Or else the "scale"-Parameter will be passed directly to the config-class ...
I found a potential faulty implementation in the buy action. I implemented my agents based on this script and found out that my agents aren't buying any supplies from the market despite them being readily available on the market at affordable prices.
It seems that purchase
isn't being used anywhere and because rations and poultices aren't in the buy_upgrade
, it is likely that the itm
got skipped and the buy action is never updated. This is given that the agents haven't put poultices or rations into the wishlist, but from my understanding, the wishlist and supplies are meant to be separated.
I am willing to work on a small PR if you are busy doing something else.
Failure # 1 (occurred at 2022-04-25_11-36-54)
Traceback (most recent call last):
File "/home/zsd/anaconda3/envs/nmmo/lib/python3.9/site-packages/ray/tune/trial_runner.py", line 893, in _process_trial
results = self.trial_executor.fetch_result(trial)
File "/home/zsd/anaconda3/envs/nmmo/lib/python3.9/site-packages/ray/tune/ray_trial_executor.py", line 707, in fetch_result
result = ray.get(trial_future[0], timeout=DEFAULT_GET_TIMEOUT)
File "/home/zsd/anaconda3/envs/nmmo/lib/python3.9/site-packages/ray/_private/client_mode_hook.py", line 105, in wrapper
return func(*args, **kwargs)
File "/home/zsd/anaconda3/envs/nmmo/lib/python3.9/site-packages/ray/worker.py", line 1733, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AssertionError): �[36mray::PPO.train()�[39m (pid=449, ip=172.22.54.224, repr=PPO)
File "/home/zsd/nmmo/baselines/rllib_wrapper.py", line 243, in train
stats = super().train()
File "/home/zsd/anaconda3/envs/nmmo/lib/python3.9/site-packages/ray/tune/trainable.py", line 315, in train
result = self.step()
File "/home/zsd/anaconda3/envs/nmmo/lib/python3.9/site-packages/ray/rllib/agents/trainer.py", line 982, in step
raise e
File "/home/zsd/anaconda3/envs/nmmo/lib/python3.9/site-packages/ray/rllib/agents/trainer.py", line 963, in step
step_attempt_results = self.step_attempt()
File "/home/zsd/anaconda3/envs/nmmo/lib/python3.9/site-packages/ray/rllib/agents/trainer.py", line 1066, in step_attempt
step_results.update(self.evaluate())
File "/home/zsd/nmmo/baselines/rllib_wrapper.py", line 253, in evaluate
assert 'Raw_Policy_IDs' in stats, err
AssertionError: Missing evaluation key. Patch RLlib as per the installation guide
In clean_pufferl.py, there is one line: "self.policy_store = pufferlib.policy_store.DirectoryPolicyStore". However, in pufferlib.policy_store, there is only PolicyStore instead of DirectoryPolicyStore. I tried to use PolicyStore to bypass this problem. But later I encounter
) for p in self.policy_store.select_policies(self.policy_selector)
AttributeError: 'PolicyStore' object has no attribute 'select_policies'
hello, I have been paying attention to the progress of the neuralmmo environment, thank you for your contribution. I have few questions about 2023nips neuralmmo competition.
I wonder if we need to submit the team decision model which makes decision for 8 agents, while I didn’t find any message about ‘Team’ on Alcrowd page. And it is unclear that how to get team message in baseline.
If the submitted models are based on teams, it is unclear how the competition will be ranked and what kind of task file will be used for evaluating and ranking.
Is there some clearer tutorials and instructions about this game like last year? I would like to express my gratitude again and hope that I can get more clear information to help me participate in this competition.
OS: Ubuntu 16.04
Description:
Traceback (most recent call last):
File "/home/xxx/neural-mmo/baselines/train.py", line 14, in <module>
from model.realikun.baseline_agent import BaselineAgent
File "/home/xxx/neural-mmo/baselines/model/realikun/baseline_agent.py", line 10, in <module>
from model.realikun.policy import BaselinePolicy
File "/home/xxx/neural-mmo/baselines/model/realikun/policy.py", line 5, in <module>
from env.nmmo_team_env import NMMOTeamEnv
File "/home/xxx/neural-mmo/baselines/env/nmmo_team_env.py", line 8, in <module>
from feature_extractor.feature_extractor import FeatureExtractor
File "/home/xxx/neural-mmo/baselines/feature_extractor/feature_extractor.py", line 6, in <module>
from feature_extractor.map_helper import MapHelper
File "/home/xxx/neural-mmo/baselines/feature_extractor/map_helper.py", line 9, in <module>
from nmmo.io import action
ModuleNotFoundError: No module named 'nmmo.io'
ModuleNotFoundError: No module named 'nmmo.io'
by changing from nmmo.io import action
to from nmmo.core import action
in /home/xxx/neural-mmo/baselines/feature_extractor/map_helper.py", line 9.python train.py
:Traceback (most recent call last):
File "/home/xxx/neural-mmo/baselines/train.py", line 14, in <module>
from model.realikun.baseline_agent import BaselineAgent
File "/home/xxx/neural-mmo/baselines/model/realikun/baseline_agent.py", line 10, in <module>
from model.realikun.policy import BaselinePolicy
File "/home/xxx/neural-mmo/baselines/model/realikun/policy.py", line 5, in <module>
from env.nmmo_team_env import NMMOTeamEnv
File "/home/xxx/neural-mmo/baselines/env/nmmo_team_env.py", line 8, in <module>
from feature_extractor.feature_extractor import FeatureExtractor
File "/home/xxx/neural-mmo/baselines/feature_extractor/feature_extractor.py", line 6, in <module>
from feature_extractor.map_helper import MapHelper
File "/home/xxx/neural-mmo/baselines/feature_extractor/map_helper.py", line 34, in <module>
material.Forest.index: material.Scrub.index,
AttributeError: module 'nmmo.lib.material' has no attribute 'Forest'
9. Thus, there are some bugs, can the baselines
repository run successfully?
Followed the installation instructions, running main.py throws 'TypeError: Object of type property is not JSON serializable' from wandb.init. Any advice would be appreciated
full traceback:
Traceback (most recent call last):
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/wandb_init.py", line 931, in init
run = wi.init()
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/wandb_init.py", line 579, in init
ret = backend.interface.communicate_run(run, timeout=30)
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/interface/interface.py", line 209, in communicate_run
run = self._make_run(run_obj)
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/interface/interface.py", line 164, in _make_run
self._make_config(data=config_dict, obj=proto_run.config)
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/interface/interface.py", line 146, in _make_config
update.value_json = json_dumps_safer(json_friendly(v)[0]) # type: ignore
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/util.py", line 750, in json_dumps_safer
return json.dumps(obj, cls=WandBJSONEncoder, **kwargs)
File "/usr/lib/python3.9/json/init.py", line 234, in dumps
return cls(
File "/usr/lib/python3.9/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.9/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/util.py", line 705, in default
return json.JSONEncoder.default(self, obj)
File "/usr/lib/python3.9/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type property is not JSON serializable
wandb: ERROR Abnormal program exit
Traceback (most recent call last):
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/wandb_init.py", line 931, in init
run = wi.init()
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/wandb_init.py", line 579, in init
ret = backend.interface.communicate_run(run, timeout=30)
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/interface/interface.py", line 209, in communicate_run
run = self._make_run(run_obj)
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/interface/interface.py", line 164, in _make_run
self._make_config(data=config_dict, obj=proto_run.config)
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/sdk/interface/interface.py", line 146, in _make_config
update.value_json = json_dumps_safer(json_friendly(v)[0]) # type: ignore
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/util.py", line 750, in json_dumps_safer
return json.dumps(obj, cls=WandBJSONEncoder, **kwargs)
File "/usr/lib/python3.9/json/init.py", line 234, in dumps
return cls(
File "/usr/lib/python3.9/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.9/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/home/dannysollo/.local/lib/python3.9/site-packages/wandb/util.py", line 705, in default
return json.JSONEncoder.default(self, obj)
File "/usr/lib/python3.9/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type property is not JSON serializable
[2022-04-25 18:24:10,728 E 4497 4497] core_worker.cc:1274: Pushed Error with JobID: 01000000 of type: task with message: ray::RolloutWorker.sample()::Exiting (pid=4497, ip=172.17.0.3, repr=<ray.rllib.evaluation.rollout_worker.modify_class..Class object at 0x7f8f95c8cc40>)
File "/root/miniconda3/lib/python3.8/site-packages/ray/rllib/evaluation/rollout_worker.py", line 761, in sample
batches = [self.input_reader.next()]
File "/root/miniconda3/lib/python3.8/site-packages/ray/rllib/evaluation/sampler.py", line 104, in next
batches = [self.get_data()]
File "/root/miniconda3/lib/python3.8/site-packages/ray/rllib/evaluation/sampler.py", line 266, in get_data
item = next(self._env_runner)
File "/root/miniconda3/lib/python3.8/site-packages/ray/rllib/evaluation/sampler.py", line 634, in _env_runner
_process_observations(
File "/root/miniconda3/lib/python3.8/site-packages/ray/rllib/evaluation/sampler.py", line 963, in _process_observations
callbacks.on_episode_end(
File "/root/neural-mmo/baselines/rllib_wrapper.py", line 305, in on_episode_end
policy = inv_map[policy_id].name
KeyError: 3 at time: 1.65088e+09
In https://github.com/NeuralMMO/baselines/blob/v1.5.4/demos/training.py, line 11, import rllib_wrapper
, I cannot find any package or component called "rllib_wrapper" containing a component "RLlibEnv
", which is called in line 37 in the same file. Could someone please help me with this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.