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

[Fix] Add more verbosewandb import error #1374

Merged
merged 1 commit into from
Feb 13, 2023
Merged

Conversation

dbogunowicz
Copy link
Contributor

@dbogunowicz dbogunowicz commented Feb 9, 2023

More verbose error message instructing the user to install wandb. Fix for https://app.asana.com/0/1201735099598270/1203877616112261/f

Traceback (most recent call last):
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/utils/logger.py", line 41, in <module>
    import wandb
ModuleNotFoundError: No module named 'wandb'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ubuntu/damian/sparseml/src/sparseml/transformers/text_classification.py", line 55, in <module>
    from sparseml.pytorch.utils.distributed import record
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/__init__.py", line 51, in <module>
    from .framework import detect_framework, framework_info, is_supported
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/framework/__init__.py", line 24, in <module>
    from .info import *
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/framework/info.py", line 26, in <module>
    from sparseml.pytorch.sparsification import sparsification_info
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/sparsification/__init__.py", line 24, in <module>
    from .distillation import *
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/sparsification/distillation/__init__.py", line 17, in <module>
    from .modifier_distillation import *
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/sparsification/distillation/modifier_distillation.py", line 24, in <module>
    from sparseml.pytorch.sparsification.distillation.modifier_distillation_base import (
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/sparsification/distillation/modifier_distillation_base.py", line 30, in <module>
    from sparseml.pytorch.sparsification.modifier import (
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/sparsification/modifier.py", line 36, in <module>
    from sparseml.pytorch.utils import LOGGING_LEVELS, BaseLogger, LoggerManager
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/utils/__init__.py", line 26, in <module>
    from .logger import *
  File "/home/ubuntu/damian/sparseml/src/sparseml/pytorch/utils/logger.py", line 47, in <module>
    raise ModuleNotFoundError(
ModuleNotFoundError: Error: Failed to import wandb. Please install the wandb library in order to use it.

@dbogunowicz dbogunowicz changed the title [Fix] Add wandb as a dependency [Fix] Add more verbosewandb import error Feb 10, 2023
anmarques
anmarques previously approved these changes Feb 10, 2023
rahul-tuli
rahul-tuli previously approved these changes Feb 10, 2023
bfineran
bfineran previously approved these changes Feb 10, 2023
@dbogunowicz
Copy link
Contributor Author

It was necessary to move the ModuleNotFoundError inside the init of the function, not to automatically throw an error during the import of the loggers module.

@dbogunowicz dbogunowicz merged commit e95716e into main Feb 13, 2023
@dbogunowicz dbogunowicz deleted the feature/damian/add_wandb branch February 13, 2023 15:29
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

5 participants