-
Notifications
You must be signed in to change notification settings - Fork 412
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
Error importing libraries (Python 3.12.1) #261
Comments
Hi Dini, Your issue is related to the incompatibility of Module This import statement should be adjust to |
Any chance a PR with this fix is coming soon? Thanks for the amazing lib |
how do i adjust to 'import torchvision.transforms.functional as F_t'? as the error comes from this line from pytorchvideo.transforms import (ApplyTransformToKey, Normalize, RandomShortSideScale, UniformTemporalSubsample, Permute) |
There are several ways to go about this. Which is best depends on the requirements of your applications. If you just want to run this script locally on your machine these are the steps:
Your script should now run without this error being thrown. Alternatively, you can run this command in Windows Powershell (seems you are on Windows): |
🐛 Bugs / Unexpected behaviors
Hi everyone I am experiencing an error when importing these libraries for pytorchvideo with python 3.12.1. I have tried using python 3.11.7 version but also received the same error.
Instructions To Reproduce the Issue:
Import libraries:
from pytorchvideo.transforms import (ApplyTransformToKey, Normalize, RandomShortSideScale, UniformTemporalSubsample, Permute)
The exact command(s) you ran:
import libraries as step 1
Error log:
ModuleNotFoundError Traceback (most recent call last)
Cell In[6], line 3
1 from pytorchvideo.data import LabeledVideoDataset, Kinetics, make_clip_sampler
----> 3 from pytorchvideo.transforms import (ApplyTransformToKey, Normalize, RandomShortSideScale, UniformTemporalSubsample, Permute)
5 from torchvision.transforms import (Compose, Lambda, RandomCrop, RandomHorizontalFlip, Resize)
7 from torchvision.transforms._transforms_video import (CenterCropVideo, NormalizeVideo)
File c:\Users\pnanurdb\AppData\Local\Programs\Python\Python312\Lib\site-packages\pytorchvideo\transforms_init_.py:3
1 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
----> 3 from .augmix import AugMix # noqa
4 from .mix import CutMix, MixUp, MixVideo # noqa
5 from .rand_augment import RandAugment # noqa
File c:\Users\pnanurdb\AppData\Local\Programs\Python\Python312\Lib\site-packages\pytorchvideo\transforms\augmix.py:6
3 from typing import Any, Dict, Optional
5 import torch
----> 6 from pytorchvideo.transforms.augmentations import (
7 _AUGMENTATION_MAX_LEVEL,
8 AugmentTransform,
9 _decreasing_int_to_arg,
10 _decreasing_to_arg,
11 _increasing_magnitude_to_arg,
12 _increasing_randomly_negate_to_arg,
13 )
...
----> 9 import torchvision.transforms.functional_tensor as F_t
10 from torchvision.transforms.functional import InterpolationMode
13 # Maximum global magnitude used for video augmentation.
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'
How do i solved the no module named 'torchvision.transforms.functional_tensor'? I followed the steps in https://pytorchvideo.org/docs/tutorial_torchhub_inference but keep on receiving error when importing libraries.
The text was updated successfully, but these errors were encountered: