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

catch and handle wandb error when it is disabled #1282

Merged
merged 2 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions helpers/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,18 +1648,32 @@ def init_trackers(self):
tracker_run_name = (
self.config.tracker_run_name or "simpletuner-training-run"
)
self.accelerator.init_trackers(
project_name,
config=vars(public_args),
init_kwargs={
"wandb": {
"name": tracker_run_name,
"id": f"{public_args_hash}",
"resume": "allow",
"allow_val_change": True,
}
},
)
try:
self.accelerator.init_trackers(
project_name,
config=vars(public_args),
init_kwargs={
"wandb": {
"name": tracker_run_name,
"id": f"{public_args_hash}",
"resume": "allow",
"allow_val_change": True,
}
},
)
except Exception as e:
if "Object has no attribute 'disabled'" in repr(e):
logger.warning(
"WandB is disabled, and Accelerate was not quite happy about it."
)
else:
logger.error(f"Could not initialize trackers: {e}")
self._send_webhook_raw(
structured_data={
"message": f"Could not initialize trackers. Continuing without. {e}"
},
message_type="error",
)
self._send_webhook_raw(
structured_data=public_args.__dict__,
message_type="training_config",
Expand Down
30 changes: 15 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ diffusers = {git = "https://github.com/huggingface/diffusers"}
transformers = "^4.47.1"
datasets = "^3.0.1"
bitsandbytes = "^0.45.0"
wandb = "^0.19.1"
wandb = "^0.19.4"
requests = "^2.32.3"
pillow = "^11.0.0"
opencv-python = "^4.10.0.84"
Expand Down
Loading