Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Training Error #642

Closed
ANTZ314 opened this issue Oct 19, 2022 · 7 comments
Closed

Training Error #642

ANTZ314 opened this issue Oct 19, 2022 · 7 comments
Assignees

Comments

@ANTZ314
Copy link

ANTZ314 commented Oct 19, 2022

Describe the bug

  • Runtime error at training ""

To Reproduce

Steps to reproduce the behavior:

No changes were made to the provided Colab workbook:

Open In Colab by @bth5

Expected behaviour

  • I ran the exact same sequence of commands on Google Colab and was able to compile multiple models (padim & cflow) and achieve various inferences from the trained model.
  • Command run:
!python tools/train.py --config anomalib/models/padim/config.yaml

ERROR response when running training command:

Traceback (most recent call last):
File "tools/train.py", line 71, in
train()
File "tools/train.py", line 49, in train
config = get_configurable_parameters(model_name=args.model, config_path=args.config)
File "/usr/local/lib/python3.7/dist-packages/anomalib/config/config.py", line 160, in get_configurable_parameters
config.metrics.threshold.pixel_default = config.metrics.threshold.image_default
File "/usr/local/lib/python3.7/dist-packages/omegaconf/dictconfig.py", line 356, in getattr
key=key, value=None, cause=e, type_override=ConfigAttributeError
File "/usr/local/lib/python3.7/dist-packages/omegaconf/base.py", line 237, in _format_and_raise
type_override=type_override,
File "/usr/local/lib/python3.7/dist-packages/omegaconf/_utils.py", line 900, in format_and_raise
_raise(ex, cause)
File "/usr/local/lib/python3.7/dist-packages/omegaconf/_utils.py", line 798, in _raise
raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace
File "/usr/local/lib/python3.7/dist-packages/omegaconf/dictconfig.py", line 352, in getattr
key=key, default_value=DEFAULT_MARKER, validate_key=False
File "/usr/local/lib/python3.7/dist-packages/omegaconf/dictconfig.py", line 443, in _get_impl
key=key, throw_on_missing_key=True, validate_key=validate_key
File "/usr/local/lib/python3.7/dist-packages/omegaconf/basecontainer.py", line 78, in _get_child
throw_on_missing_key=throw_on_missing_key,
File "/usr/local/lib/python3.7/dist-packages/omegaconf/dictconfig.py", line 480, in _get_node
raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key image_default
full_key: metrics.threshold.image_default
object_type=dict

Hardware and Software Configuration

  • GOOGLE COLAB
  • Python 3 Google Compute Engine backend (GPU)
  • [standard Colab account specs as of 2022-10-19]

Additional context

  • The suggested fix is to install an older version "omegaconf==2.0.0", however, this leads to a new error.
@ANTZ314 ANTZ314 changed the title Missing key image_default Training Error Oct 19, 2022
@samet-akcay
Copy link
Contributor

@ANTZ314, this is probably due to one of our recent PRs #637. I'll check the notebooks and fix them if needed.

@samet-akcay samet-akcay self-assigned this Oct 20, 2022
@JACKYNIKK
Copy link

Same happens for me

@samet-akcay
Copy link
Contributor

interesting, we tried to ensure the backward compatibility, but apparently, it is broken. @JACKYNIKK, can you confirm you have this issue in the jupyter notebooks as well?

@JACKYNIKK
Copy link

I'm sorry, you mean if the same problem happens if i run the lines in my local jupyter notebook instead of running it online on colab? Or is something else meant?

@samet-akcay
Copy link
Contributor

I meant Jupyter notebook in general, both local or cloud? Or do you also have this issue when you run train.py as well?

@JACKYNIKK
Copy link

Im not sure if this is what was meant.
Anyway i tried to create a new enviroment on anaconda on my pc. Then openend a jupyter notebook in this enviroment and cloned the repository with: "!git clone https://github.com/openvinotoolkit/anomalib.git". After that i ran:
"!pip install anomalib" and got into the right folder with :"cd anomalib".
If i run: "!python tools/train.py --config anomalib/models/padim/config.yaml" at this point as in the colab i get the same exact error as on colab. i report a screen here:
GITHUB

Even if i use this repository i'm unexperienced with python, colab, cloud and so on and i'm not sure i understood what was meant. Hope this was it, otherwise let me know if i should try something else.

@samet-akcay
Copy link
Contributor

samet-akcay commented Oct 21, 2022

@ANTZ314, @JACKYNIKK, the problem is that the jupyter notebook installs anomalib via pip, which installs v0.3.6 now. You clone the repo via !git clone https://github.com/openvinotoolkit/anomalib.git, which clones the latest commit, and causes conflict with the pypi version.

Solution
For now, if you clone and install anomalib as the following, the problem would temporarily be resolved.

Option - 1
Train the model via

!python tools/train.py --model padim

Option - 2
Install the library locally

!git clone https://github.com/openvinotoolkit/anomalib.git
%cd anomalib
!pip install -e .

We'll soon update the pypi version with v0.3.7, which would remedy this issue completely.

@openvinotoolkit openvinotoolkit locked and limited conversation to collaborators Oct 21, 2022
@samet-akcay samet-akcay converted this issue into discussion #645 Oct 21, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants