utils.py 704 B

123456789101112131415161718192021
  1. '''Copyright The Microsoft DeepSpeed Team'''
  2. def check_tb_availability():
  3. try:
  4. # torch.utils.tensorboard will fail if `tensorboard` is not available,
  5. # see their docs for more details: https://pytorch.org/docs/1.8.0/tensorboard.html
  6. import tensorboard # noqa: F401
  7. except ImportError:
  8. print('If you want to use tensorboard logging, please `pip install tensorboard`')
  9. raise
  10. def check_wandb_availability():
  11. try:
  12. import wandb # noqa: F401
  13. except ImportError:
  14. print(
  15. 'If you want to use wandb logging, please `pip install wandb` and follow the instructions at https://docs.wandb.ai/quickstart'
  16. )
  17. raise