-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Open
Description
🐛 Describe the bug
Using Kinetics400 from references leads to a deprecation warning. The fastest way to reproduce:
torchrun --nproc_per_node=8 train.py --data-path /datasets01/kinetics/070618/ --train-dir=val_avi-480p --val-dir=val_avi-480p --batch-size=64 --sync-bn --test-only --weights R2Plus1D_18_Weights.DEFAULT --cache-dataset
./vision/torchvision/io/video.py:160: UserWarning: The pts_unit 'pts' gives wrong results and will be removed in a follow-up version. Please use pts_unit 'sec'.
warnings.warn(
It seems this is due to the following line:
vision/torchvision/datasets/video_utils.py
Line 327 in b7c59a0
video, audio, info = read_video(video_path, start_pts, end_pts) |
Which calls the method with the default parameter for pts_unit="pts"
which is deprecated:
vision/torchvision/io/video.py
Lines 155 to 163 in b7c59a0
if pts_unit == "sec": | |
start_offset = int(math.floor(start_offset * (1 / stream.time_base))) | |
if end_offset != float("inf"): | |
end_offset = int(math.ceil(end_offset * (1 / stream.time_base))) | |
else: | |
warnings.warn( | |
"The pts_unit 'pts' gives wrong results and will be removed in a " | |
+ "follow-up version. Please use pts_unit 'sec'." | |
) |
If the specific option is deprecated, TorchVision shouldn't be using the feature.
Versions
Latest main branch