Skip to content

Commit

Permalink
Merge pull request datamllab#284 from Clarivy/master
Browse files Browse the repository at this point in the history
Fix RuntimeError when running example from docs\toy-examples.md
  • Loading branch information
daochenzha authored May 15, 2023
2 parents ee60aff + e1834a9 commit fe65713
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion rlcard/agents/dqn_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
SOFTWARE.
'''

import os
import random
import numpy as np
import torch
Expand Down Expand Up @@ -319,7 +320,7 @@ def save_checkpoint(self, path, filename='checkpoint_dqn.pt'):
Args:
path (str): the path to save the model
'''
torch.save(self.checkpoint_attributes(), path + '/' + filename)
torch.save(self.checkpoint_attributes(), os.path.join(path, filename))

class Estimator(object):
'''
Expand Down
3 changes: 2 additions & 1 deletion rlcard/agents/nfsp_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
See the paper https://arxiv.org/abs/1603.01121 for more details.
'''

import os
import random
import collections
import enum
Expand Down Expand Up @@ -370,7 +371,7 @@ def save_checkpoint(self, path, filename='checkpoint_nfsp.pt'):
Args:
path (str): the path to save the model
'''
torch.save(self.checkpoint_attributes(), path + '/' + filename)
torch.save(self.checkpoint_attributes(), os.path.join(path, filename))


class AveragePolicyNetwork(nn.Module):
Expand Down

0 comments on commit fe65713

Please sign in to comment.