Skip to content

Unclear error messages when misconfiguring data #131

Description

@lemairecarl

In my project, the following config works:
runner.py task=segmentation task/model=enet data=radrec data.dataset_path=<DATASET_PATH>

Here is the error I get if I omit the data.* args:
runner.py task=segmentation task/model=enet

omegaconf.errors.MissingMandatoryValue: Missing mandatory value: data._target_
    full_key: data._target_
    object_type=dict

This message does not inform of the real problem, which is that data is not set. I'm thinking it might be better if we make data mandatory. That way, the error message would clearly say that data is missing, instead of one of its keys.

The following is another unclear error message that is related.

I have created a new task in my project by copy-pasting segmentation.yaml. I only changed the _target_. Here is what happens when I omit data.* like above, but with my own task:
runner.py task=radrec task/model=enet

task=radrec task/model=enet
omegaconf.errors.InterpolationKeyError: Interpolation key 'data.image_tag' not found
    full_key: task.image_tag
    object_type=dict

It's weird that I don't get the same message. But also, it seems like making data mandatory would help. (By the way, after setting data and data.dataset_path, it works.)

Another error that I find unclear is when I omit just data.dataset_path; the error does not mention the actual argument name:

hydra.errors.InstantiationException: Error in call to target 'radrec.dataset.datamodule.RadrecDataModule':
TypeError('expected str, bytes or os.PathLike object, not NoneType')
full_key: data

Note that data/radrec.yaml contains dataset_path: null.

Any thoughts?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions