Training Error
See original GitHub issueDescribe the bug
- Runtime error at training “”
To Reproduce
Steps to reproduce the behavior:
No changes were made to the provided Colab workbook:
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 <module> 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.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
@ANTZ314, this is probably due to one of our recent PRs #637. I’ll check the notebooks and fix them if needed.
@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
Option - 2 Install the library locally
We’ll soon update the pypi version with v0.3.7, which would remedy this issue completely.