-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove warnings #111
Remove warnings #111
Conversation
1c89995
to
07264ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!! LGTM. Left a few comments/suggestions. Feel free to ignore.
import warnings | ||
|
||
import imageio | ||
|
||
|
||
def write_video(video_path, stacked_frames, fps): | ||
# Filter out DeprecationWarnings raised from pkg_resources | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings( | ||
"ignore", "pkg_resources is deprecated as an API", category=DeprecationWarning | ||
) | ||
imageio.mimsave(video_path, stacked_frames, fps=fps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename io_utils.py
to io.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this in a previous python project and it's okay until you need to import io
from the standard library. It's confusing so I wouldn't recommend it.
def write_video(video_path, stacked_frames, fps): | ||
# Filter out DeprecationWarnings raised from pkg_resources | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings( | ||
"ignore", "pkg_resources is deprecated as an API", category=DeprecationWarning | ||
) | ||
imageio.mimsave(video_path, stacked_frames, fps=fps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why cant we use imageio as an API without warning?
What are the alternatives to generate an mp4 from a numpy array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to understand. To be clear, the problem here with imageio.mimsave
is that it calls pkg_resources
at some point down the line (in imageio-ffmpeg
actually), which raises this warning. As mentioned before, a fix has been pushed on their main but it hasn't made its way to a release yet so we just have to handle it on our side until then.
- Replace `use_pretrained_backbone` with `pretrained_backbone_weights` - Bump diffusers' minimum version `0.26.3` -> `0.27.2` - Add ignore flags in CI's pytest - Change Box observation spaces in simulation environments - Set `version_base="1.2"` in Hydra initializations - Bump einops' minimum version `0.7.0` -> `0.8.0`
Remove warnings
Progress: Done ✅ (0 down from 117 warnings)
use_pretrained_backbone
(bool
) withpretrained_backbone_weights
(str | None
) in ACT and Diffusion configs in order to use theweights
parameter instead of the deprecatedpretrained
parameter when initializing those backbones. Solves Handle torchvision deprecation warning #78.After digging a bit, it look like this warning is triggered simply by this importfrom diffusers.schedulers.scheduling_ddpm import DDPMScheduler
so this has more to do with diffusers. @alexander-soare I saw your TODO commentRemove reliance on diffusers for DDPMScheduler and LR scheduler
, so I guess this would solve this?EDIT: Fix deprecation warning for torch.utils._pytree._register_pytree_node in PyTorch 2.2 diffusers#7008 actually solves this, I've bumped diffusers' minimum version
0.26.3
->0.27.2
pkg_ressources
. Therefore, we can only silent those until those libraries fix it themselves.pygame
in gym-pusht: I've pushed a fix to silent it Remove "pkg_resources deprecated" warning gym-pusht#7imageio.mimsave
: a fix has recently been pushed toimageio-ffmpeg
but it hasn't made its way into a release yet so I guess we'll just have to wait. In the meantime, I've pushed a fix to silence it. This one doesn't appear in the CI for some reason but it does in my local tests.num_worker
is hardcoded as e.g. 4, 8. After discussing this with @Cadene, since we don't want to change those values or set them dynamically in the code, I've added a-W ignore::UserWarning:torch.utils.data.dataloader:558
flag in the CI's pytest command.UserWarning: WARN: For Box action spaces, we recommend using a symmetric and normalized space (range=[-1, 1] or [0, 1]). See https://stable-baselines3.readthedocs.io/en/master/guide/rl_tips.html for more information.
I've added a
-W ignore::UserWarning:gymnasium.utils.env_checker:247
flag in the CI's pytest command.UserWarning: The version_base parameter is not specified. Please specify a compatability version level, or None. Will assume defaults for version 1.1
version_base="1.2"
in Hydra initializations/home/runner/work/lerobot/lerobot/.venv/lib/python3.10/site-packages/einops/einops.py:827: DeprecationWarning: invalid escape sequence '\s'
einops
version from0.7.0
->0.8.0