Documented example code failing to run

#2
by davidrs - opened

My guess is a dependency issue. I'm on Python 12.
It would be nice to have some more deps guidance in the demo code, or the lib needs to set tighter restrictions on expected versions of dep libs like timm

ImportError: cannot import name '_update_default_kwargs' from 'timm.models._builder'

Error:

poetry run python -m scripts.fastervit
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/src/app_deploy/drs_test/scripts/fastervit.py", line 1, in <module>
    from fastervit import create_model
  File ".cache/pypoetry/virtualenvs/drs-test-ZJ9tOeei-py3.12/lib/python3.12/site-packages/fastervit/__init__.py", line 1, in <module>
    from .models.registry import create_model
  File ".cache/pypoetry/virtualenvs/drs-test-ZJ9tOeei-py3.12/lib/python3.12/site-packages/fastervit/models/__init__.py", line 1, in <module>
    from .faster_vit import *
  File ".cache/pypoetry/virtualenvs/drs-test-ZJ9tOeei-py3.12/lib/python3.12/site-packages/fastervit/models/faster_vit.py", line 15, in <module>
    from timm.models._builder import resolve_pretrained_cfg, _update_default_kwargs
ImportError: cannot import name '_update_default_kwargs' from 'timm.models._builder' (.cache/pypoetry/virtualenvs/drs-test-ZJ9tOeei-py3.12/lib/python3.12/site-packages/timm/models/_builder.py). Did you mean: '_update_default_model_kwargs'?

Deps:

[tool.poetry.dependencies]
python = "^3.11"
torch = "*"
transformers = "*"
pandas = "^2.2.3"
fastervit = "^0.9"

Found a fix over on github:

you should install version timm==0.9.6. latest version dose not work.

Sign up or log in to comment