Skip to content

Commit

Permalink
Omus critical error fixed (#211)
Browse files Browse the repository at this point in the history
* Add files via upload

* Add files via upload

* Add files via upload

* Update README.md

* Update README.md

* Update README.md

* Update fiftyfiftyminigame.cfg

* Create requirements.txt

* Update README.md

* Update README.md

* Add files via upload

* Update fiftyfiftyminigame.cfg

* Add files via upload

* Update fiftyfiftyminigame.py

* Add files via upload

* Update fiftyfiftyminigame.py

* Update README.md

* Add files via upload

* Add files via upload

* Add files via upload

* Delete Omus_model.zip

* Add files via upload

* Create README.md

* Add files via upload
  • Loading branch information
Dan-SmashRepair authored May 29, 2022
1 parent 917b358 commit 9e67994
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions RLBotPack/Omus/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ class Agent:
def __init__(self):
_path = pathlib.Path(__file__).parent.resolve()
custom_objects = {
"lr_schedule": 0.000001,
"lr_schedule": 5e-5,
"clip_range": .02,
"n_envs": 1,
}

self.actor = PPO.load(str(_path) + '/Omus_model.zip', device='cpu', custom_objects=custom_objects)
self.omus_50 = PPO.load(str(_path) + '/Omus_50_model.zip', device='cpu', custom_objects=custom_objects)
self.omus_ko = PPO.load(str(_path) + '/Omus_KO_model.zip', device='cpu', custom_objects=custom_objects)
self.parser = DiscreteAction()


def act(self, state):
action = self.actor.predict(state, deterministic=True)
#x = self.parser.parse_actions(action[0], state)
def act(self, state, gamemode):
if gamemode =='fiftyfifty':
action = self.omus_50.predict(state, deterministic=True)
elif gamemode =='kickoff':
action = self.omus_ko.predict(state, deterministic=True)

return action[0]

Expand Down

0 comments on commit 9e67994

Please sign in to comment.