Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions rlcard/agents/cfr_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def eval_step(self, state):
action (int): Predicted action
info (dict): A dictionary containing information
'''
probs = self.action_probs(state['obs'].tostring(), list(state['legal_actions'].keys()), self.average_policy)
probs = self.action_probs(state['obs'].tobytes(), list(state['legal_actions'].keys()), self.average_policy)
action = np.random.choice(len(probs), p=probs)

info = {}
Expand All @@ -173,7 +173,7 @@ def get_state(self, player_id):
legal_actions (list): Indices of legal actions
'''
state = self.env.get_state(player_id)
return state['obs'].tostring(), list(state['legal_actions'].keys())
return state['obs'].tobytes(), list(state['legal_actions'].keys())

def save(self):
''' Save model
Expand Down Expand Up @@ -218,4 +218,3 @@ def load(self):
iteration_file = open(os.path.join(self.model_path, 'iteration.pkl'),'rb')
self.iteration = pickle.load(iteration_file)
iteration_file.close()