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

Error in Beginner's Tutorial #5

Closed
lithiumhydride2 opened this issue Jul 21, 2022 · 1 comment
Closed

Error in Beginner's Tutorial #5

lithiumhydride2 opened this issue Jul 21, 2022 · 1 comment

Comments

@lithiumhydride2
Copy link

when i try the example in README.md:

To test, evaluate, and render()

# for a general example 
python3 algos/maTT/run_script.py --mode test --render 1 --log_dir ./results/maTT/setTracking-v0_123456789/seed_0/ --nb_test_eps 50

An error occurred in setTracking_v0.py:

/home/lih/miniconda3/envs/scalableMARL/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:4: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if not hasattr(tensorboard, "__version__") or LooseVersion(
/home/lih/桌面/RL/scalableMARL-main/envs/maTTenv/maps/map_utils.py:24: UserWarning: loadtxt: Empty input file: "/home/lih/桌面/RL/scalableMARL-main/envs/maTTenv/maps/emptyMed.cfg"
  self.map = np.loadtxt(map_path+".cfg")
/home/lih/miniconda3/envs/scalableMARL/lib/python3.8/site-packages/gym/spaces/box.py:128: UserWarning: WARN: Box bound precision lowered by casting to float32
  logger.warn(f"Box bound precision lowered by casting to {self.dtype}")
/home/lih/miniconda3/envs/scalableMARL/lib/python3.8/site-packages/gym/core.py:329: DeprecationWarning: WARN: Initializing wrapper in old step API which returns one bool instead of two. It is recommended to set `new_step_api=True` to use new step API. This will be the default behaviour in future.
  deprecation(
Traceback (most recent call last):
  File "algos/maTT/run_script.py", line 207, in <module>
    test(args.seed)
  File "algos/maTT/run_script.py", line 146, in test
    Eval.test(args, env, policy)
  File "/home/lih/桌面/RL/scalableMARL-main/algos/maTT/evaluation.py", line 82, in test
    obs = env.reset(**params)
  File "/home/lih/桌面/RL/scalableMARL-main/envs/maTTenv/display_wrapper.py", line 119, in reset
    return self.env.reset(**kwargs)
  File "/home/lih/桌面/RL/scalableMARL-main/envs/utilities/ma_time_limit.py", line 30, in reset
    return self.env.reset(**kwargs)
  File "/home/lih/桌面/RL/scalableMARL-main/envs/maTTenv/env/setTracking_v0.py", line 120, in reset
    self.agents[ii].reset(init_pose['agents'][ii])
IndexError: list index out of range

And I did not make any changes to the original program

@christopher-hsu
Copy link
Owner

you first need to train a policy before you can evaluate it.
secondly, this is probably an issue with the test set. if your test set is larger than the number of agents initialized, then it will output this error.

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

2 participants