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

Invalid parameter in first Tune notebook #51

Open
apaleyes opened this issue Jun 4, 2021 · 0 comments
Open

Invalid parameter in first Tune notebook #51

apaleyes opened this issue Jun 4, 2021 · 0 comments

Comments

@apaleyes
Copy link
Contributor

apaleyes commented Jun 4, 2021

The very first example that Tune course runs is defined like this:

analysis = tune.run(
    "PPO",                                    # Use proximal policy optimization to train 
    stop={"episode_reward_mean": 400},        # Stopping criteria, when average reward over the episodes
                                              # of training equals 400 out of a maximum possible 500 score.
    config={
        "env": "CartPole-v1",                 # Tune can associate this string with the environment.
        "num_gpus": 0,                        # If you have GPUs, go for it!
        "num_workers": 3,                     # Number of Ray workers to use; Use one LESS than 
                                              # the number of cores you wan to use (or omit this argument)!
        "model": {                            # The NN model we'll optimize.
            'fcnet_hiddens': [                # "Fully-connected network with N hidden layers".
                tune.grid_search([20, 40]),   # Try these four values for layer one.
                tune.grid_search([20, 40])    # Try these four values for layer one.
            ]
        },
        "eager": False,                       # Flag for TensorFlow; don't use eager evaluation.
    },
    verbose=1
)

This failed for me, saying that Tensorflow doesn't recognize eager parameter. So I've removed it, and it failed again, this time there was some TF/Numpy conversion issue. Then I found this issue , and it confirms that eager should not be used anymore. Following the conversation there, I got the following working code:

analysis = tune.run(
    "PPO",                                    # Use proximal policy optimization to train 
    stop={"episode_reward_mean": 400},        # Stopping criteria, when average reward over the episodes
                                              # of training equals 400 out of a maximum possible 500 score.
    config={
        "env": "CartPole-v1",                 # Tune can associate this string with the environment.
        "num_gpus": 0,                        # If you have GPUs, go for it!
        "num_workers": 3,                     # Number of Ray workers to use; Use one LESS than 
                                              # the number of cores you wan to use (or omit this argument)!
        "model": {                            # The NN model we'll optimize.
            'fcnet_hiddens': [                # "Fully-connected network with N hidden layers".
                tune.grid_search([20, 40]),   # Try these four values for layer one.
                tune.grid_search([20, 40])    # Try these four values for layer one.
            ]
        },
        "framework": "tfe",
        #"eager": False,                       # Flag for TensorFlow; don't use eager evaluation.
    },
    verbose=1
)

Not sure if this is the proper fix, so just an issue here and not a PR. But hopefully that helps the next person going through the Tune course.

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

1 participant