Project-MONAI / Project-MONAI/tutorials

num_patches_per_image missing in the default config file for swinunetr

Open
#1,848 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
2.5k
Forks
803
Avg merge
6d 22h
Merged PRs (30d)
3

Description

I am trying to run auto3Dseg with swinunetr backbone. I follow the toy example, however, I am getting the following error:

Traceback (most recent call last):
File "/home/z004br3h/projects/rg_segmentation/exp/pretrain_headneck_rev_3_swinunetr/swinunetr_0/scripts/train.py", line 850, in
fire.Fire()
File "/home/z004br3h/python/pyenv/pt2/lib/python3.10/site-packages/fire/core.py", line 143, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/home/z004br3h/python/pyenv/pt2/lib/python3.10/site-packages/fire/core.py", line 477, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/home/z004br3h/python/pyenv/pt2/lib/python3.10/site-packages/fire/core.py", line 693, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/home/z004br3h/projects/rg_segmentation/exp/pretrain_headneck_rev_3_swinunetr/swinunetr_0/scripts/train.py", line 192, in run
train_transforms = parser.get_parsed_content("transforms_train")
File "/home/z004br3h/python/pyenv/pt2/lib/python3.10/site-packages/monai/bundle/config_parser.py", line 290, in get_parsed_content
return self.ref_resolver.get_resolved_content(id=id, **kwargs)
File "/home/z004br3h/python/pyenv/pt2/lib/python3.10/site-packages/monai/bundle/reference_resolver.py", line 193, in get_resolved_content
return self._resolve_one_item(id=id, **kwargs)
File "/home/z004br3h/python/pyenv/pt2/lib/python3.10/site-packages/monai/bundle/reference_resolver.py", line 163, in _resolve_one_item
self._resolve_one_item(id=d, waiting_list=waiting_list, **kwargs)
File "/home/z004br3h/python/pyenv/pt2/lib/python3.10/site-packages/monai/bundle/reference_resolver.py", line 163, in _resolve_one_item
self._resolve_one_item(id=d, waiting_list=waiting_list, **kwargs)
File "/home/z004br3h/python/pyenv/pt2/lib/python3.10/site-packages/monai/bundle/reference_resolver.py", line 159, in _resolve_one_item
raise ValueError(msg) from err
ValueError: the referring item @num_patches_per_image is not defined in the config content.

The variable num_patches_per_image is not defined in the default hyperparameter.yaml. Does this variable need to be set manually?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the default hyperparameter.yaml used by the swinunetr Auto3DSeg toy example, then search the configuration for @num_patches_per_image and its other references. Reproduce the example to confirm the config-parser failure and determine the expected configuration behavior. Done means the default configuration no longer references an undefined variable and the example progresses past transform parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.