-
Notifications
You must be signed in to change notification settings - Fork 35
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
Lightning not printing richbar (0.99.8rc1) #316
Comments
The following script is generated by AI Agent to help reproduce the issue: # terratorch/reproduce.py
import os
from lightning.pytorch.callbacks import RichProgressBar
from terratorch.cli_tools import build_lightning_cli
def test_progress_bar():
command_list = ["fit", "-c", "tests/resources/configs/manufactured-finetune_prithvi_swin_B.yaml"]
cli = build_lightning_cli(command_list)
trainer = cli.trainer # Ensure the trainer is correctly assigned
if not any(isinstance(callback, RichProgressBar) for callback in trainer.callbacks):
raise AssertionError("Progress bar is not displayed")
else:
# Check if the progress bar is actually printing to console
import io
import sys
captured_output = io.StringIO()
sys.stdout = captured_output
trainer.fit(cli.model, cli.datamodule)
sys.stdout = sys.__stdout__
if "Epoch" not in captured_output.getvalue():
raise AssertionError("Progress bar is not printing to console")
if __name__ == "__main__":
try:
test_progress_bar()
except AssertionError as e:
raise AssertionError(e)
else:
print("Test passed successfully with no errors!") How to run: python3 terratorch/reproduce.py Expected Result:
Thank you for your valuable contribution to this project and we appreciate your feedback! Please respond with an emoji if you find this script helpful. Feel free to comment below if any improvements are needed. Best regards from an AI Agent! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The model runs, but doesn't print the progress bar.
The text was updated successfully, but these errors were encountered: