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

Changed key for SegKDLoss #1620

Merged
merged 5 commits into from
Nov 10, 2023
Merged

Conversation

hakuryuu96
Copy link
Contributor

When starting KDTrainer from super_gradients.train_from_kd_recipe, an error occurs:

Traceback (most recent call last):
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/super_gradients/train_from_kd_recipe.py", line 26, in <module>
    main()
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/super_gradients/train_from_kd_recipe.py", line 22, in main
    _main()
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/main.py", line 94, in decorated_main
    _run_hydra(
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/utils.py", line 394, in _run_hydra
    _run_app(
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/utils.py", line 457, in _run_app
    run_and_report(
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/utils.py", line 223, in run_and_report
    raise ex
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/utils.py", line 220, in run_and_report
    return func()
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/utils.py", line 458, in <lambda>
    lambda: hydra.run(
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/clearml/binding/hydra_bind.py", line 99, in _patched_hydra_run
    return PatchHydra._original_hydra_run(self, config_name, task_function, overrides, *args, **kwargs)
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 132, in run
    _ = ret.return_value
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/core/utils.py", line 260, in return_value
    raise self._return_value
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/core/utils.py", line 186, in run_job
    ret.return_value = task_function(task_cfg)
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/clearml/binding/hydra_bind.py", line 182, in _patched_task_function
    return task_function(a_config, *a_args, **a_kwargs)
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/super_gradients/train_from_kd_recipe.py", line 17, in _main
    KDTrainer.train_from_config(cfg)
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/super_gradients/training/kd_trainer/kd_trainer.py", line 60, in train_from_config
    cfg = hydra.utils.instantiate(cfg)
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 226, in instantiate
    return instantiate_node(
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 366, in instantiate_node
    cfg[key] = instantiate_node(
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 358, in instantiate_node
    dict_items[key] = instantiate_node(
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 347, in instantiate_node
    return _call_target(_target_, partial, args, kwargs, full_key)
  File "/home/phil/.local/share/virtualenvs/deci-I-VYGHkF/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 97, in _call_target
    raise InstantiationException(msg) from e
hydra.errors.InstantiationException: Error in call to target 'super_gradients.training.losses.seg_kd_loss.SegKDLoss':
TypeError("__init__() got an unexpected keyword argument 'KDLogitsLoss'")

All worked after changing KDLogitsLoss -> kd_loss in the recipe.

Copy link
Contributor

@BloodAxe BloodAxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BloodAxe BloodAxe merged commit 5c419d2 into Deci-AI:master Nov 10, 2023
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants