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

[torchvision IC] catch import error for instantiation of optional tensorboard logger #1456

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

bfineran
Copy link
Member

tensorboard is now an optional dependency and the logger should only be instantiated during torchvision training if it is present. this patch catches the error and raises a warning

test_plan:
manually verified for example command:

sparseml.image_classification.train     --recipe "zoo:cv/classification/resnet_v1-50/pytorch/sparseml/imagenette/pruned-conservative?recipe_type=original"     --dataset-path /home/data/imagenette/imagenette-320     --pretrained True     --arch-key resnet50     --batch-size 128     --workers 8     --output-dir sparsification_example/resnet50-imagenette-pruned     --save-best-after 8
Not using distributed mode

warnings before training:

sparseml/src/sparseml/pytorch/torchvision/train.py:585: UserWarning: Unable to import tensorboard for logging
  warnings.warn("Unable to import tensorboard for logging")
sparseml/src/sparseml/pytorch/torchvision/train.py:592: UserWarning: Unable to import wandb for logging
  warnings.warn("Unable to import wandb for logging")

@bfineran bfineran self-assigned this Mar 17, 2023
@bfineran bfineran merged commit 8d28ae0 into main Mar 17, 2023
@bfineran bfineran deleted the torchvision-tensorboard-optional-instantiation branch March 17, 2023 17:53
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.

None yet

3 participants