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

AttributeError in train() while running the tutorial .ipynb #4

Open
marcoboresta opened this issue Nov 20, 2024 · 0 comments
Open

AttributeError in train() while running the tutorial .ipynb #4

marcoboresta opened this issue Nov 20, 2024 · 0 comments

Comments

@marcoboresta
Copy link

I encountered an issue while running the train() function in the tutorial .ipynb file. The error occurs because the wandb attribute in the SAC class is not initialized before being accessed in the learn() function.

Steps to Reproduce:

  1. Clone the repository.
  2. Install all dependencies from requirements.txt.
  3. Open the provided tutorial .ipynb file.
  4. Execute the following cell in the notebook:

from train import train
config = {
"simulator.name": "macro",
"model.name": "sac",
"simulator.city": "nyc_brooklyn",
"model.cplexpath": None,
"model.checkpoint_path": "SAC_custom",
"model.max_episodes": 5,
}
train(config)

  1. Observe the following error:
    AttributeError: 'SAC' object has no attribute 'wandb'

Suggested Fix:

Add self.wandb = None to the init method of the SAC class in src/algos/sac.py to ensure the attribute is initialized.

Thank you for the repository and the tutorial!

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