Skip to content

Commit

Permalink
Disable advice warnings from PyTorch
Browse files Browse the repository at this point in the history
There are a number of warnings in PyTorch that represent advice for
improving model, data loader, and training decisions. However these
warnings are confusing to end users and often aren't clearly relevant
even for advanced users. As a result, PyTorch supports disabling these
class of warnings, PossibleUserWarnings.

See:
https://lightning.ai/docs/pytorch/2.4.0/advanced/warnings.html
Lightning-AI/pytorch-lightning#10644

This change follows the recommended approach to hide these warnings
from users.
  • Loading branch information
ethanwhite committed Aug 10, 2024
1 parent 80cb7d8 commit fa8f1df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deepforest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
__version__ = '1.3.3'

import os
from pytorch_lightning.utilities import disable_possible_user_warnings

_ROOT = os.path.abspath(os.path.dirname(__file__))

# Disable PyTorch warnings that confuse users
disable_possible_user_warnings()


def get_data(path):
"""Helper function to get package sample data."""
Expand Down

0 comments on commit fa8f1df

Please sign in to comment.