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

AimLogger not working with PyTorch lightning #3088

Open
gursi26 opened this issue Jan 9, 2024 · 1 comment
Open

AimLogger not working with PyTorch lightning #3088

gursi26 opened this issue Jan 9, 2024 · 1 comment
Labels
type / question Issue type: question

Comments

@gursi26
Copy link

gursi26 commented Jan 9, 2024

❓Question

Here is my code for the PyTorch lightning trainer

import lightning as L

trainer = L.Trainer(
    max_epochs=EPOCHS,
    accelerator=DEVICE,
    logger = aim.Run(experiment="trial_exp_lightning")
)
trainer.fit(training_module, train_loader, test_loader)

Upon running this, I get the following error message.

AttributeError: 'Run' object has no attribute 'save_dir'

I have checked previous issues in both the lightning and aim repos and it seems that integration is possible, so im wondering how I should go about fixing this.

@gursi26 gursi26 added the type / question Issue type: question label Jan 9, 2024
@tamohannes
Copy link
Contributor

Hey @gursi26, Aim provides a built-in callback manager specifically designed for PyTorch Lightning. It is highly recommended to utilize this manager to handle all PyTorch Lightning events effectively.

Here's how your code snippet will appear after making those changes:

import lightning as L

aim_logger = AimLogger(
    experiment_name="trial_exp_lightning",
)

trainer = L.Trainer(
    max_epochs=EPOCHS,
    accelerator=DEVICE,
    logger = aim_logger
)
trainer.fit(training_module, train_loader, test_loader)

You can refer for more details on this page: https://aimstack.readthedocs.io/en/latest/quick_start/integrations.html#integration-with-pytorch-lightning

Feel free to share any additional issues you may encounter ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type / question Issue type: question
Projects
None yet
Development

No branches or pull requests

2 participants