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

[question]Saving Problem #2

Closed
wujiren opened this issue Jun 9, 2020 · 2 comments
Closed

[question]Saving Problem #2

wujiren opened this issue Jun 9, 2020 · 2 comments

Comments

@wujiren
Copy link

wujiren commented Jun 9, 2020

Saving Problem
Hi, I am very excited that stable baselines has a tf2 version, which could make me much easier to develop custom policies.
I have tried a small demo of PPO, it seems works well. After learning, i found that save method is quite different from tf1 version stable baselines and it seems not implemented yet.
If I want to implement it, should I just implement the save/load method in BasePolicy class shown as below, and there is nothing else in the whole model need to be saved?

class BasePolicy(Model):
    """
    The base policy object

    :param observation_space: (Gym Space) The observation space of the environment
    :param action_space: (Gym Space) The action space of the environment
    """

    def __init__(self, observation_space, action_space):
        super(BasePolicy, self).__init__()
        self.observation_space = observation_space
        self.action_space = action_space

    def save(self, path):
        """
        Save model to a given location.

        :param path: (str)
        """
        raise NotImplementedError()

    def load(self, path):
        """
        Load saved model from path.

        :param path: (str)
        """
        raise NotImplementedError()

Hoping your guidance with my best wishes.

@araffin
Copy link
Member

araffin commented Jun 9, 2020

Hello,
As mentioned in the README, this is an experimental version.
After discussion with the other maintainers, we decided to go for pytorch instead: hill-a/stable-baselines#733

You can find a beta version of v3 here: https://github.com/DLR-RM/stable-baselines3
It has all the basic features (including saving/loading) implemented.

I think I will update the readme to avoid any confusion.

@wujiren
Copy link
Author

wujiren commented Jun 9, 2020

Hello,
As mentioned in the README, this is an experimental version.
After discussion with the other maintainers, we decided to go for pytorch instead: hill-a/stable-baselines#733

You can find a beta version of v3 here: https://github.com/DLR-RM/stable-baselines3
It has all the basic features (including saving/loading) implemented.

I think I will update the readme to avoid any confusion.

thanks for reply. I will try the pytorch version.

@wujiren wujiren closed this as completed Jun 18, 2020
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