-
Notifications
You must be signed in to change notification settings - Fork 323
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
Import warning on unused optional libraries: wandb, gym #563
Comments
Hi! thanks for your contribution!, great first issue! |
@its-dron Hi, thank you for your suggestion! Your suggestion sounds reasonable!
|
Does anyone have a solution to this? The import warnings
from pl_bolts.utils.stability import UnderReviewWarning
warnings.simplefilter("ignore", UnderReviewWarning) Edit: Is pl-bolts doing something wrong with the warnings? import warnings
warnings.simplefilter("ignore")
warnings.warn("test")
import pl_bolts # Raises "UnderReviewWarning"
exit() The |
This is causing real problems for DDP usage with multiple workers in DataLoaders. When running with DDP_spawn with multi-worker dataloaders, the message prints hundreds of times per epoch. I have isolated the issue with this warning to the following line (line 75 in stability.py):
This attaches the new filter to the beginning of Printing My proposed fix is to change that line to read I'm new to lightning-bolts so I'm not sure how I can raise this as a PR, but would be happy to do so! Currently have it patched in my own code with the following hacky solution:
|
To avoid disabling all warnings, I changed |
It is also not so clear how to stop this behavior when using hydra's instantiate function for example. |
hello, is this still present in the latest |
"I'm on version 0.7.0, and I'm still having this issue but @shubhamkulkarni01's solution works for me. |
🐛 Bug
If
wandb
isn't installed, a warning is thrown upon importpl_bolts
that alerts us to installwandb
, before we've made any attempt nor effort to use it. The same warning occurs forgym
.To Reproduce
pl_bolts
but withoutwandb
.python -c 'import pl_bolts'
Expected behavior
No warnings about uninstalled downstream libraries until we attempt to use them.
Environment
pl_bolts 0.3.0
Additional context
Appears to have been introduced in #477
The text was updated successfully, but these errors were encountered: