Skip to content
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

Issue with Unpack #101

Open
ahatamiz opened this issue Dec 30, 2024 · 1 comment
Open

Issue with Unpack #101

ahatamiz opened this issue Dec 30, 2024 · 1 comment

Comments

@ahatamiz
Copy link

ahatamiz commented Dec 30, 2024

I installed fla from the source.

But now facing this error when trying to import fla:

import fla
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.10/site-packages/fla/__init__.py", line 3, in <module>
    from fla.layers import (ABCAttention, Attention, BasedLinearAttention,
  File "/opt/conda/lib/python3.10/site-packages/fla/layers/__init__.py", line 7, in <module>
    from .delta_net import DeltaNet
  File "/opt/conda/lib/python3.10/site-packages/fla/layers/delta_net.py", line 12, in <module>
    from transformers.processing_utils import Unpack
  File "/opt/conda/lib/python3.10/site-packages/transformers/processing_utils.py", line 33, in <module>
    from .image_utils import ChannelDimension, is_valid_image, is_vision_available
  File "/opt/conda/lib/python3.10/site-packages/transformers/image_utils.py", line 59, in <module>
    from torchvision.transforms import InterpolationMode
  File "/opt/conda/lib/python3.10/site-packages/torchvision/__init__.py", line 6, in <module>
    from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils
  File "/opt/conda/lib/python3.10/site-packages/torchvision/_meta_registrations.py", line 164, in <module>
    def meta_nms(dets, scores, iou_threshold):
  File "/opt/conda/lib/python3.10/site-packages/torch/library.py", line 795, in register
    use_lib._register_fake(op_name, func, _stacklevel=stacklevel + 1)
  File "/opt/conda/lib/python3.10/site-packages/torch/library.py", line 184, in _register_fake
    handle = entry.fake_impl.register(func_to_register, source)
  File "/opt/conda/lib/python3.10/site-packages/torch/_library/fake_impl.py", line 31, in register
    if torch._C._dispatch_has_kernel_for_dispatch_key(self.qualname, "Meta"):
RuntimeError: operator torchvision::nms does not exist

Weirdly, if you uninstall torchvision, the problem is gone. This is probably some circular import issue.

By the way, torchvision is automatically installed in most cases when installing torch so this may become problematic for some users.

@yzhangcs
Copy link
Member

@ahatamiz Hi, can't reproduce your problems 😢 .
This could be a bug of python/torch/transformers version mismatch.
I just removed all related imports into TYPE_CHCEKING. Hoping this can fix your errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants