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

hydra.errors.InstantiationException when running the default HYDRA_FULL_ERROR=1 run_align_system #131

Open
wjdghks950 opened this issue Nov 5, 2024 · 1 comment

Comments

@wjdghks950
Copy link

While integrating our existing CodeActAgent codebase with the updated align-system, we decided run the run_align_system command first to see if the system would work without error. However, we got the following error (pasting the full stack trace using HYDRA_FULL_ERROR=1):

Error executing job with overrides: []
Traceback (most recent call last):
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/utils.py", line 644, in _locate
    obj = getattr(obj, part)
AttributeError: module 'align_system.interfaces' has no attribute 'input_output_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/utils.py", line 650, in _locate
    obj = import_module(mod)
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/align_system/interfaces/input_output_file.py", line 8, in <module>
    from align_system.utils.hydrate_state import hydrate_scenario_state
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/align_system/utils/hydrate_state.py", line 1, in <module>
    from swagger_client.models import (
ImportError: cannot import name 'Aid' from 'swagger_client.models' (/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/swagger_client/models/__init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 134, in _resolve_target
    target = _locate(target)
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/utils.py", line 658, in _locate
    raise ImportError(
ImportError: Error loading 'align_system.interfaces.input_output_file.InputOutputFileInterface':
ImportError("cannot import name 'Aid' from 'swagger_client.models' (/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/swagger_client/models/__init__.py)")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/bin/run_align_system", line 8, in <module>
    sys.exit(main())
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/main.py", line 94, in decorated_main
    _run_hydra(
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/utils.py", line 394, in _run_hydra
    _run_app(
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/utils.py", line 457, in _run_app
    run_and_report(
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/utils.py", line 223, in run_and_report
    raise ex
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/utils.py", line 220, in run_and_report
    return func()
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/utils.py", line 458, in <lambda>
    lambda: hydra.run(
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/hydra.py", line 132, in run
    _ = ret.return_value
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/core/utils.py", line 260, in return_value
    raise self._return_value
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/core/utils.py", line 186, in run_job
    ret.return_value = task_function(task_cfg)
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/align_system/cli/run_align_system.py", line 25, in main
    cfg = instantiate(cfg, recursive=True)
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 226, in instantiate
    return instantiate_node(
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 366, in instantiate_node
    cfg[key] = instantiate_node(
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 333, in instantiate_node
    _target_ = _resolve_target(node.get(_Keys.TARGET), full_key)
  File "/shared/nas/data/m1/jk100/.conda/envs/align_system/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 139, in _resolve_target
    raise InstantiationException(msg) from e
hydra.errors.InstantiationException: Error locating target 'align_system.interfaces.input_output_file.InputOutputFileInterface', set env var HYDRA_FULL_ERROR=1 to see chained exception.
full_key: interface

What could be causing this issue? Did anyone encounter this issue as well?

Thank you.

@dmjoy
Copy link
Contributor

dmjoy commented Nov 5, 2024

I suspect the issue is that the version of the itm-evaluation-client that gets installed by default with the environment is out of date (something I need to update in the pyproject.toml file). For now I would recommend locally cloning this repo: https://github.com/NextCenturyCorporation/itm-evaluation-client and check out the development branch, then do a pip install -e /path/to/local/itm-evaluation-client to install it from the local clone. Then try again, certainly let me know if that doesn't fix it for you.

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