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

Error on import #9

Open
a-Rahmati opened this issue Aug 15, 2024 · 1 comment
Open

Error on import #9

a-Rahmati opened this issue Aug 15, 2024 · 1 comment

Comments

@a-Rahmati
Copy link

Hello

When I import from backbones_unet.model.unet import Unet a value error raise:

>>> from backbones_unet.model.unet import Unet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.12/site-packages/backbones_unet/model/unet.py", line 3, in <module>
    from timm import create_model
  File "/usr/local/lib/python3.12/site-packages/timm/__init__.py", line 2, in <module>
    from .models import create_model, list_models, is_model, list_modules, model_entrypoint, \
  File "/usr/local/lib/python3.12/site-packages/timm/models/__init__.py", line 28, in <module>
    from .maxxvit import *
  File "/usr/local/lib/python3.12/site-packages/timm/models/maxxvit.py", line 225, in <module>
    @dataclass
     ^^^^^^^^^
  File "/usr/lib64/python3.12/dataclasses.py", line 1275, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/usr/lib64/python3.12/dataclasses.py", line 1265, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/dataclasses.py", line 994, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/dataclasses.py", line 852, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'timm.models.maxxvit.MaxxVitConvCfg'> for field conv_cfg is not allowed: use default_factory

My python version is 3.12.4:
Python 3.12.4 (main, Jun 7 2024, 00:00:00) [GCC 14.1.1 20240607 (Red Hat 14.1.1-5)] on linux

@CBDevelopment
Copy link

CBDevelopment commented Sep 17, 2024

I am experiencing the same error: ValueError: mutable default <class 'timm.models.maxxvit.MaxxVitConvCfg'> for field conv_cfg is not allowed: use default_factory

Edit: Downgrading to Python 3.9.6 allowed install

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