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

AUROC error while running classification of pathology images #817

Open
sylwiamm opened this issue Mar 12, 2024 · 3 comments
Open

AUROC error while running classification of pathology images #817

sylwiamm opened this issue Mar 12, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@sylwiamm
Copy link
Contributor

sylwiamm commented Mar 12, 2024

Describe the bug

A clear and concise description of what the bug is.
Metrics error while running pathology classification on the cluster.

To Reproduce

Steps to reproduce the behavior:

  1. Use the data 'TIL classification'
  2. Run 'Classification, model VGG16'
  3. See error (it would be helpful to include the error message and stack trace)
ERROR: Traceback (most recent call last):
  File "GaNDLF/gandlf_run", line 126, in <module>
    main_run(
  File "GaNDLF/GANDLF/cli/main_run.py", line 103, in main_run
    TrainingManager_split(
  File "GaNDLF/GANDLF/training_manager.py", line 348, in TrainingManager_split
    training_loop(
  File "GaNDLF/GANDLF/compute/training_loop.py", line 346, in training_loop
    overall_metrics = overall_stats(
  File "GaNDLF/GANDLF/metrics/__init__.py", line 120, in overall_stats
    return classification.overall_stats(predictions, ground_truth, params)
  File "GaNDLF/GANDLF/metrics/classification.py", line 77, in overall_stats
    output_metrics[metric_name] = get_output_from_calculator(
  File "GaNDLF/GANDLF/utils/tensor.py", line 540, in get_output_from_calculator
    temp_output = calculator(prediction, target)
  File "dev_gandlf/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "dev_gandlf/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "dev_gandlf/lib/python3.9/site-packages/torchmetrics/metric.py", line 298, in forward
    self._forward_cache = self._forward_reduce_state_update(*args, **kwargs)
  File "dev_gandlf/lib/python3.9/site-packages/torchmetrics/metric.py", line 368, in _forward_reduce_state_update
    batch_val = self.compute()
  File "dev_gandlf/lib/python3.9/site-packages/torchmetrics/metric.py", line 607, in wrapped_func
    value = _squeeze_if_scalar(compute(*args, **kwargs))
  File "dev_gandlf/lib/python3.9/site-packages/torchmetrics/classification/auroc.py", line 123, in compute
    return _binary_auroc_compute(state, self.thresholds, self.max_fpr)
  File "dev_gandlf/lib/python3.9/site-packages/torchmetrics/functional/classification/auroc.py", line 88, in _binary_auroc_compute
    fpr, tpr, _ = _binary_roc_compute(state, thresholds, pos_label)
  File "dev_gandlf/lib/python3.9/site-packages/torchmetrics/functional/classification/roc.py", line 54, in _binary_roc_compute
    fps, tps, thres = _binary_clf_curve(preds=state[0], target=state[1], pos_label=pos_label)
  File "dev_gandlf/lib/python3.9/site-packages/torchmetrics/functional/classification/precision_recall_curve.py", line 61, in _binary_clf_curve
    target = target[desc_score_indices]
IndexError: index 7 is out of bounds for dimension 0 with size 5

Expected behavior

It supposed to work :)

Media

If applicable, add images, screenshots or other relevant media to help explain your problem.

Environment information

GaNDLF version, OS, and any other relevant information.

Additional context

Add any other context about the problem here.

@sylwiamm sylwiamm changed the title [BUG] AUROC error while running classification of pathology images AUROC error while running classification of pathology images [BUG] Mar 12, 2024
@sylwiamm sylwiamm changed the title AUROC error while running classification of pathology images [BUG] AUROC error while running classification of pathology images Mar 12, 2024
@sylwiamm
Copy link
Contributor Author

@sarthakpati you can assign this to me

@sarthakpati sarthakpati added the bug Something isn't working label Mar 12, 2024
@sarthakpati
Copy link
Collaborator

Thanks!

I just updated the formatting a bit to make the report more legible. 😄

@scap3yvt scap3yvt mentioned this issue Apr 18, 2024
10 tasks
Copy link
Contributor

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants