Skip to content

Wandb Support #550

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

Merged
merged 10 commits into from
Apr 15, 2021
Merged

Wandb Support #550

merged 10 commits into from
Apr 15, 2021

Conversation

amaarora
Copy link
Contributor

@amaarora amaarora commented Apr 8, 2021

Use WANDB to track top-1, top-5 accuracy, validation loss, train loss..

@amaarora
Copy link
Contributor Author

amaarora commented Apr 8, 2021

@rwightman I've added Wandb support to timm which shouldn't affect any existing workflow.

A simple use case to now also use wandb would be to add the --log-wandb flag to existing training commands.

Something like:
python train.py ../data/ --model resnet34 --log-wandb

This helps track train and eval metrics and system usage.
image

Keen to hear your thoughts.

@rwightman
Copy link
Collaborator

@amaarora thanks for PR, this will be useful for some but I'd prefer not to add a hard dependency for it. Can you make it optional in the same manner I've done for some other packages, huggingface_hub is most recent example.

Is it valid to have a project name as None? If you always need a project name then one arg --wandb project_name works to both enable and specify project. In my outstanding changes I have a proper logger object which will handle this stuff, shared with csv and tensorboard writer, it'll define a common project name that something like wandb would also share. So another option is to use the name from the 'experiment' that the output/train folders use and leave --use-wandb as the enable flag only.

@amaarora
Copy link
Contributor Author

amaarora commented Apr 10, 2021

but I'd prefer not to add a hard dependency for it.

Thanks Ross, valid point. I've put import wandb inside try-except blocks similar to apex imports. There is now only one argument log-wandb. If user requests to log to wandb but package is not found, script raises warning but continues to run. I don't think we should raise an error for this so have decided to raise a warning to let the user know that metrics won't be logged to wandb.

Is it valid to have a project name as None?

Yes. It's possible to have project name as None. I've actually made it default to args.experiment so that shared csv, tensorboard writer have common project name. In case args.experiment is None, that's also fine, then wandb logs to uncategorized project by default.

Also, I've put import wandb inside summary.py in try-except blocks similar to apex imports in validation.py. We need wandb in summary.py to log metrics that is, rowd dictionary.

@amaarora
Copy link
Contributor Author

Hey @rwightman - any update on this PR please? :)

@rwightman rwightman merged commit e685618 into huggingface:master Apr 15, 2021
guoriyue pushed a commit to guoriyue/pytorch-image-models that referenced this pull request May 24, 2024
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

Successfully merging this pull request may close these issues.

2 participants