HazyResearch / fly

Apache License 2.0
188 stars 21 forks source link

Error when running baseline inference experiments #2

Open dalistarh opened 2 years ago

dalistarh commented 2 years ago

Hi,

When running the first inference experiment in the README

python run.py experiment=imagenet-t2tvit-eval.yaml model/t2tattn_cfg=full datamodule.data_dir=/home/dan/ILSVRC/ eval.ckpt=checkpoints/t2tvit/81.7_T2T_ViTt_14.pth.tar

I get the following error:

  File "run.py", line 53, in main
    return evaluate(config)
  File "/home/dan/frameworks/pixelfly/src/eval.py", line 57, in evaluate
    trained_model: LightningModule = hydra.utils.instantiate(config.task, cfg=config,
  File "/home/dan/frameworks/pixelfly/env/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 180, in instantiate
    return instantiate_node(config, *args, recursive=_recursive_, convert=_convert_)
  File "/home/dan/frameworks/pixelfly/env/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 249, in instantiate_node
    return _call_target(target, *args, **kwargs)
  File "/home/dan/frameworks/pixelfly/env/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 64, in _call_target
    raise type(e)(
  File "/home/dan/frameworks/pixelfly/env/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 62, in _call_target
    return target(*args, **kwargs)
  File "/home/dan/frameworks/pixelfly/src/tasks/seq.py", line 41, in __init__
    self.model = hydra.utils.instantiate(self.model_cfg, _recursive_=False)
  File "/home/dan/frameworks/pixelfly/env/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 180, in instantiate
    return instantiate_node(config, *args, recursive=_recursive_, convert=_convert_)
  File "/home/dan/frameworks/pixelfly/env/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 240, in instantiate_node
    target = _resolve_target(node.get(_Keys.TARGET))
  File "/home/dan/frameworks/pixelfly/env/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 104, in _resolve_target
    return _locate(target)
  File "/home/dan/frameworks/pixelfly/env/lib/python3.8/site-packages/hydra/_internal/utils.py", line 577, in _locate
    raise ImportError(
ImportError: Error instantiating 'src.tasks.seq.SequenceModel' : Encountered error: `cannot import name 'BlockSparseLRLinear' from 'src.models.modules.layers.blocksparse_linear' (/home/dan/frameworks/pixelfly/src/models/modules/layers/blocksparse_linear.py)` when loading module 'src.models.vit.t2t_vit.t2t_vit_t_14' '''

I am attaching my `pip freeze' output in case it helps:

absl-py==1.0.0 aiohttp==3.8.1 aiosignal==1.2.0 alembic==1.7.5 antlr4-python3-runtime==4.8 anyio==3.4.0 argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 async-timeout==4.0.1 attrs==21.2.0 autopage==0.4.0 Babel==2.9.1 backcall==0.2.0 backports.entry-points-selectable==1.1.1 black==21.12b0 bleach==4.1.0 cachetools==4.2.4 certifi==2021.10.8 cffi==1.15.0 cfgv==3.3.1 charset-normalizer==2.0.9 click==8.0.3 cliff==3.10.0 cmaes==0.8.2 cmd2==2.3.3 colorama==0.4.4 colorlog==6.6.0 commonmark==0.9.1 configparser==5.2.0 cycler==0.11.0 debugpy==1.5.1 decorator==5.1.0 defusedxml==0.7.1 distlib==0.3.4 docker-pycreds==0.4.0 einops==0.3.2 entrypoints==0.3 filelock==3.4.0 flake8==4.0.1 fonttools==4.28.3 frozenlist==1.2.0 fsspec==2021.11.1 future==0.18.2 gitdb==4.0.9 GitPython==3.1.24 google-auth==2.3.3 google-auth-oauthlib==0.4.6 greenlet==1.1.2 grpcio==1.42.0 hydra-colorlog==1.1.0 hydra-core==1.1.0 hydra-optuna-sweeper==1.1.0 identify==2.4.0 idna==3.3 importlib-metadata==4.8.2 importlib-resources==5.4.0 iniconfig==1.1.1 ipykernel==6.6.0 ipython==7.30.1 ipython-genutils==0.2.0 isort==5.10.1 jedi==0.18.1 Jinja2==3.0.3 joblib==1.1.0 json5==0.9.6 jsonschema==4.2.1 jupyter-client==7.1.0 jupyter-core==4.9.1 jupyter-server==1.13.1 jupyterlab==3.2.5 jupyterlab-pygments==0.1.2 jupyterlab-server==2.8.2 kiwisolver==1.3.2 Mako==1.1.6 Markdown==3.3.6 MarkupSafe==2.0.1 matplotlib==3.5.1 matplotlib-inline==0.1.3 mccabe==0.6.1 mistune==0.8.4 multidict==5.2.0 mypy-extensions==0.4.3 nbclassic==0.3.4 nbclient==0.5.9 nbconvert==6.3.0 nbformat==5.1.3 nest-asyncio==1.5.4 nodeenv==1.6.0 notebook==6.4.6 numpy==1.21.4 oauthlib==3.1.1 omegaconf==2.1.1 optuna==2.4.0 packaging==21.3 pandas==1.3.5 pandocfilters==1.5.0 parso==0.8.3 pathspec==0.9.0 pathtools==0.1.2 pbr==5.8.0 pexpect==4.8.0 pickleshare==0.7.5 Pillow==8.4.0 platformdirs==2.4.0 pluggy==1.0.0 pre-commit==2.16.0 prettytable==2.4.0 prometheus-client==0.12.0 promise==2.3 prompt-toolkit==3.0.24 protobuf==3.19.1 psutil==5.8.0 ptyprocess==0.7.0 pudb==2021.2.2 py==1.11.0 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycodestyle==2.8.0 pycparser==2.21 pyDeprecate==0.3.1 pyflakes==2.4.0 Pygments==2.10.0 pyparsing==3.0.6 pyperclip==1.8.2 pyrsistent==0.18.0 pytest==6.2.5 python-dateutil==2.8.2 python-dotenv==0.19.2 pytorch-lightning==1.5.5 pytorch-lightning-bolts==0.3.2 pytz==2021.3 PyYAML==6.0 pyzmq==22.3.0 requests==2.26.0 requests-oauthlib==1.3.0 rich==10.16.0 rsa==4.8 scikit-learn==1.0.1 scipy==1.7.3 seaborn==0.11.2 Send2Trash==1.8.0 sentry-sdk==1.5.0 sh==1.14.2 shortuuid==1.0.8 six==1.16.0 smmap==5.0.0 sniffio==1.2.0 SQLAlchemy==1.4.28 stevedore==3.5.0 subprocess32==3.5.4 tensorboard==2.7.0 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.0 termcolor==1.1.0 terminado==0.12.1 testpath==0.5.0 threadpoolctl==3.0.0 timm==0.4.12 toml==0.10.2 tomli==1.2.2 torch==1.10.0 torchmetrics==0.6.1 torchvision==0.11.1 tornado==6.1 tqdm==4.62.3 traitlets==5.1.1 typing-extensions==4.0.1 urllib3==1.26.7 urwid==2.1.2 urwid-readline==0.13 virtualenv==20.10.0 wandb==0.12.7 wcwidth==0.2.5 webencodings==0.5.1 websocket-client==1.2.3 Werkzeug==2.0.2 yarl==1.7.2 yaspin==2.1.0 zipp==3.6.0 '''

Thanks, Dan

Asha-Gutlapalli commented 2 years ago

I am facing the same issue. Any suggestions or comments will be appreciated.

Thanks

abhishektyaagi commented 8 months ago

@dalistarh @Asha-Gutlapalli Were you able to fix this issue? If yes, is it possible to share your pip freeze output?