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

v2.4.1 raises ValueError: not enough values to unpack when calling predict_single_npy_array #2112

Closed
joshuacwnewton opened this issue Apr 18, 2024 · 2 comments · Fixed by #2114
Assignees

Comments

@joshuacwnewton
Copy link
Contributor

joshuacwnewton commented Apr 18, 2024

Note

I see a flurry of activity on the PyPI History, so it's possible that you're already aware of this. If so, my apologies for adding to the noise!

  • We have a CI workflow that installs the most up-to-date version of nnuntv2 and runs inference tests.
  • Our CI started failing after the upgrade to v2.4. Retrying the tests with v2.4.1 results in the same error.

Traceback:

  File "/__w/spinalcordtoolbox/spinalcordtoolbox/spinalcordtoolbox/deepseg/inference.py", line 228, in segment_nnunet
    pred = predictor.predict_single_npy_array(
  File "/__w/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/nnunetv2/inference/predict_from_raw_data.py", line 442, in predict_single_npy_array
    dct = next(ppa)
  File "/__w/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/batchgenerators/dataloading/data_loader.py", line 126, in __next__
    return self.generate_train_batch()
  File "/__w/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/nnunetv2/inference/data_iterators.py", line 193, in generate_train_batch
    image, seg_prev_stage, props, ofname = self._data[idx][0]
ValueError: not enough values to unpack (expected 4, got 1)

def generate_train_batch(self):
idx = self.get_indices()[0]
image, seg_prev_stage, props, ofname = self._data[idx][0]

It looks like this issue may be due to d87fa5b. (I don't think the [0] should be present anymore for the unpacking to work successfully.)

Thank you for your time and effort maintaining this package! ♥️

@joshuacwnewton
Copy link
Contributor Author

I've opened a PR for this issue in #2114. :)

@FabianIsensee
Copy link
Member

Thanks a lot! I am currently traveling and will merge it once I am back :-)

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 a pull request may close this issue.

3 participants