openai / maddpg

Code for the MADDPG algorithm from the paper "Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments"
https://arxiv.org/pdf/1706.02275.pdf
MIT License
1.65k stars 494 forks source link

I have train it success but how to run? How to see the visible answer? #49

Open zhijiejia opened 4 years ago

zhijiejia commented 4 years ago

I have train it success but how to run? How to see the visible answer? image

nuts-bottles commented 4 years ago

-- coding: utf-8 --

import pickle

path = "" agent_num = 3

print("....................") print("state_reward_all") print("....................")

f = open('../report/' + path + '/stat_reward_all.pkl', 'rb') info = pickle.load(f, encoding='iso-8859-1') # Soso for i in info: print(i)

dr-smgad commented 3 years ago

To see the visual environment, use the --display option with train.py but this is not recommended during training.

What you should do is after finishing training, load the saved policy visually as below:

train.py --restore --display

This is assuming that you used the default save_dir otherwise use the option --load-dir to indicate your custom load_dir