-
Notifications
You must be signed in to change notification settings - Fork 781
test error: modules/interpretability/class_lung_lesion.ipynb #984
Copy link
Copy link
Closed
Project-MONAI/MONAI
#5323Description
[2022-10-12T12:24:36.388Z] Running ./modules/interpretability/class_lung_lesion.ipynb
[2022-10-12T12:24:36.388Z] Checking PEP8 compliance...
[2022-10-12T12:24:36.951Z] Running notebook...
[2022-10-12T12:24:36.951Z] Before:
[2022-10-12T12:24:36.951Z] "max_epochs = 100\n",
[2022-10-12T12:24:37.207Z] After:
[2022-10-12T12:24:37.207Z] "max_epochs = 1\n",
[2022-10-12T12:24:37.207Z] Before:
[2022-10-12T12:24:37.207Z] "val_interval = 1\n",
[2022-10-12T12:24:37.207Z] After:
[2022-10-12T12:24:37.207Z] "val_interval = 1\n",
[2022-10-12T12:24:41.381Z] MONAI version: 1.0.0+37.g9731823d
[2022-10-12T12:24:41.381Z] Numpy version: 1.22.2
[2022-10-12T12:24:41.381Z] Pytorch version: 1.10.2+cu102
[2022-10-12T12:24:41.381Z] MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
[2022-10-12T12:24:41.381Z] MONAI rev id: 9731823da40ae7835afad601d7d2b601534c80d3
[2022-10-12T12:24:41.381Z] MONAI __file__: /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/__init__.py
[2022-10-12T12:24:41.381Z]
[2022-10-12T12:24:41.381Z] Optional dependencies:
[2022-10-12T12:24:41.381Z] Pytorch Ignite version: 0.4.10
[2022-10-12T12:24:41.381Z] Nibabel version: 4.0.2
[2022-10-12T12:24:41.381Z] scikit-image version: 0.19.3
[2022-10-12T12:24:41.381Z] Pillow version: 9.0.1
[2022-10-12T12:24:41.381Z] Tensorboard version: 2.10.0
[2022-10-12T12:24:41.381Z] gdown version: 4.5.1
[2022-10-12T12:24:41.381Z] TorchVision version: 0.11.3+cu102
[2022-10-12T12:24:41.381Z] tqdm version: 4.64.1
[2022-10-12T12:24:41.381Z] lmdb version: 1.3.0
[2022-10-12T12:24:41.381Z] psutil version: 5.9.2
[2022-10-12T12:24:41.381Z] pandas version: 1.1.5
[2022-10-12T12:24:41.381Z] einops version: 0.5.0
[2022-10-12T12:24:41.381Z] transformers version: 4.21.3
[2022-10-12T12:24:41.381Z] mlflow version: 1.29.0
[2022-10-12T12:24:41.381Z] pynrrd version: 1.0.0
[2022-10-12T12:24:41.381Z]
[2022-10-12T12:24:41.381Z] For details about installing the optional dependencies, please visit:
[2022-10-12T12:24:41.381Z] https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies
[2022-10-12T12:24:41.381Z]
[2022-10-12T12:24:42.309Z] /opt/conda/lib/python3.8/site-packages/papermill/iorw.py:153: UserWarning: the file is not specified with any extension : -
[2022-10-12T12:24:42.309Z] warnings.warn(
[2022-10-12T12:33:00.667Z]
Executing: 0%| | 0/20 [00:00<?, ?cell/s]
Executing: 5%|▌ | 1/20 [00:01<00:29, 1.54s/cell]
Executing: 10%|█ | 2/20 [00:06<01:00, 3.38s/cell]
Executing: 15%|█▌ | 3/20 [00:09<00:59, 3.48s/cell]
Executing: 20%|██ | 4/20 [00:20<01:43, 6.49s/cell]
Executing: 55%|█████▌ | 11/20 [00:24<00:15, 1.68s/cell]
Executing: 65%|██████▌ | 13/20 [00:38<00:21, 3.03s/cell]
Executing: 70%|███████ | 14/20 [00:38<00:15, 2.61s/cell]
Executing: 75%|███████▌ | 15/20 [00:40<00:12, 2.54s/cell]
Executing: 85%|████████▌ | 17/20 [00:41<00:05, 1.72s/cell]
Executing: 90%|█████████ | 18/20 [08:16<02:58, 89.20s/cell]
Executing: 90%|█████████ | 18/20 [08:18<00:55, 27.68s/cell]
[2022-10-12T12:33:00.667Z] /opt/conda/lib/python3.8/site-packages/papermill/iorw.py:153: UserWarning: the file is not specified with any extension : -
[2022-10-12T12:33:00.667Z] warnings.warn(
[2022-10-12T12:33:00.667Z] Traceback (most recent call last):
[2022-10-12T12:33:00.667Z] File "/opt/conda/bin/papermill", line 8, in <module>
[2022-10-12T12:33:00.667Z] sys.exit(papermill())
[2022-10-12T12:33:00.667Z] File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
[2022-10-12T12:33:00.667Z] return self.main(*args, **kwargs)
[2022-10-12T12:33:00.667Z] File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 1055, in main
[2022-10-12T12:33:00.667Z] rv = self.invoke(ctx)
[2022-10-12T12:33:00.667Z] File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
[2022-10-12T12:33:00.667Z] return ctx.invoke(self.callback, **ctx.params)
[2022-10-12T12:33:00.667Z] File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 760, in invoke
[2022-10-12T12:33:00.667Z] return __callback(*args, **kwargs)
[2022-10-12T12:33:00.667Z] File "/opt/conda/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
[2022-10-12T12:33:00.667Z] return f(get_current_context(), *args, **kwargs)
[2022-10-12T12:33:00.667Z] File "/opt/conda/lib/python3.8/site-packages/papermill/cli.py", line 250, in papermill
[2022-10-12T12:33:00.667Z] execute_notebook(
[2022-10-12T12:33:00.667Z] File "/opt/conda/lib/python3.8/site-packages/papermill/execute.py", line 128, in execute_notebook
[2022-10-12T12:33:00.667Z] raise_for_execution_errors(nb, output_path)
[2022-10-12T12:33:00.667Z] File "/opt/conda/lib/python3.8/site-packages/papermill/execute.py", line 232, in raise_for_execution_errors
[2022-10-12T12:33:00.667Z] raise error
[2022-10-12T12:33:00.667Z] papermill.exceptions.PapermillExecutionError:
[2022-10-12T12:33:00.667Z] ---------------------------------------------------------------------------
[2022-10-12T12:33:00.667Z] Exception encountered at "In [12]":
[2022-10-12T12:33:00.667Z] ---------------------------------------------------------------------------
[2022-10-12T12:33:00.667Z] RuntimeError Traceback (most recent call last)
[2022-10-12T12:33:00.667Z] Cell In [12], line 34
[2022-10-12T12:33:00.667Z] 31 cam_result = cam_result[..., the_slice]
[2022-10-12T12:33:00.667Z] 33 # run occlusion
[2022-10-12T12:33:00.667Z] ---> 34 occ_result, _ = occ_sens(x=image, b_box=occ_sens_b_box)
[2022-10-12T12:33:00.667Z] 35 occ_result = occ_result[..., pred_label]
[2022-10-12T12:33:00.667Z] 37 for row, (im, title) in enumerate(
[2022-10-12T12:33:00.667Z] 38 zip(
[2022-10-12T12:33:00.667Z] 39 [img, cam_result, occ_result],
[2022-10-12T12:33:00.667Z] 40 [name, "CAM", "Occ. sens."],
[2022-10-12T12:33:00.667Z] 41 )
[2022-10-12T12:33:00.667Z] 42 ):
[2022-10-12T12:33:00.667Z]
[2022-10-12T12:33:00.667Z] File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/visualize/occlusion_sensitivity.py:351, in OcclusionSensitivity.__call__(self, x, b_box, **kwargs)
[2022-10-12T12:33:00.667Z] 349 bbox_min = [max(b, 0) for b in b_box[::2]]
[2022-10-12T12:33:00.667Z] 350 bbox_max = [b if b > 0 else s for b, s in zip(b_box[1::2], x.shape[2:])]
[2022-10-12T12:33:00.667Z] --> 351 cropper = SpatialCrop(roi_start=bbox_min, roi_end=bbox_max)
[2022-10-12T12:33:00.667Z] 352 sensitivity_im = cropper(sensitivity_im[0])[None] # type: ignore
[2022-10-12T12:33:00.667Z] 354 # The most probable class is the max in the classification dimension (1)
[2022-10-12T12:33:00.667Z]
[2022-10-12T12:33:00.667Z] File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/transforms/croppad/array.py:497, in SpatialCrop.__init__(self, roi_center, roi_size, roi_start, roi_end, roi_slices)
[2022-10-12T12:33:00.667Z] 479 def __init__(
[2022-10-12T12:33:00.667Z] 480 self,
[2022-10-12T12:33:00.667Z] 481 roi_center: Union[Sequence[int], NdarrayOrTensor, None] = None,
[2022-10-12T12:33:00.667Z] (...)
[2022-10-12T12:33:00.667Z] 485 roi_slices: Optional[Sequence[slice]] = None,
[2022-10-12T12:33:00.667Z] 486 ) -> None:
[2022-10-12T12:33:00.667Z] 487 """
[2022-10-12T12:33:00.667Z] 488 Args:
[2022-10-12T12:33:00.667Z] 489 roi_center: voxel coordinates for center of the crop ROI.
[2022-10-12T12:33:00.667Z] (...)
[2022-10-12T12:33:00.667Z] 495 roi_slices: list of slices for each of the spatial dimensions.
[2022-10-12T12:33:00.668Z] 496 """
[2022-10-12T12:33:00.668Z] --> 497 self.slices = self.compute_slices(
[2022-10-12T12:33:00.668Z] 498 roi_center=roi_center, roi_size=roi_size, roi_start=roi_start, roi_end=roi_end, roi_slices=roi_slices
[2022-10-12T12:33:00.668Z] 499 )
[2022-10-12T12:33:00.668Z]
[2022-10-12T12:33:00.668Z] File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/transforms/croppad/array.py:417, in Crop.compute_slices(roi_center, roi_size, roi_start, roi_end, roi_slices)
[2022-10-12T12:33:00.668Z] 415 roi_start_t = torch.maximum(roi_start_t, torch.zeros_like(roi_start_t))
[2022-10-12T12:33:00.668Z] 416 roi_end_t = convert_to_tensor(data=roi_end, dtype=torch.int16, wrap_sequence=True)
[2022-10-12T12:33:00.668Z] --> 417 roi_end_t = torch.maximum(roi_end_t, roi_start_t)
[2022-10-12T12:33:00.668Z] 418 # convert to slices (accounting for 1d)
[2022-10-12T12:33:00.668Z] 419 if roi_start_t.numel() == 1:
[2022-10-12T12:33:00.668Z]
[2022-10-12T12:33:00.668Z] RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels