Project-MONAI / tutorials

MONAI Tutorials
https://monai.io/started.html
Apache License 2.0
1.85k stars 682 forks source link

KeyError in ./pathology/tumor_detection/ignite/profiling_camelyon_pipeline.ipynb #1810

Closed KumoLiu closed 2 months ago

KumoLiu commented 2 months ago

[2024-09-02T23:25:00.613Z] Running ./pathology/tumor_detection/ignite/profiling_camelyon_pipeline.ipynb
[2024-09-02T23:25:04.387Z]   from torch.distributed.optim import ZeroRedundancyOptimizer
[2024-09-02T23:25:08.550Z] MONAI version: 1.4.0rc6+2.gdbfe418c
[2024-09-02T23:25:08.550Z] Numpy version: 1.24.4
[2024-09-02T23:25:08.550Z] Pytorch version: 2.4.0+cu121
[2024-09-02T23:25:08.550Z] MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
[2024-09-02T23:25:08.550Z] MONAI rev id: dbfe418c03073baf07a0e14cd7606571f3d0de18
[2024-09-02T23:25:08.550Z] MONAI __file__: /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/__init__.py
[2024-09-02T23:25:08.550Z] 
[2024-09-02T23:25:08.550Z] Optional dependencies:
[2024-09-02T23:25:08.550Z] Pytorch Ignite version: 0.4.11
[2024-09-02T23:25:08.550Z] ITK version: 5.4.0
[2024-09-02T23:25:08.550Z] Nibabel version: 5.2.1
[2024-09-02T23:25:08.550Z] scikit-image version: 0.23.2
[2024-09-02T23:25:08.550Z] scipy version: 1.14.0
[2024-09-02T23:25:08.550Z] Pillow version: 10.4.0
[2024-09-02T23:25:08.550Z] Tensorboard version: 2.16.2
[2024-09-02T23:25:08.550Z] gdown version: 5.2.0
[2024-09-02T23:25:08.550Z] TorchVision version: 0.19.0+cu121
[2024-09-02T23:25:08.550Z] tqdm version: 4.66.5
[2024-09-02T23:25:08.550Z] lmdb version: 1.5.1
[2024-09-02T23:25:08.550Z] psutil version: 6.0.0
[2024-09-02T23:25:08.550Z] pandas version: 2.2.2
[2024-09-02T23:25:08.550Z] einops version: 0.7.0
[2024-09-02T23:25:08.550Z] transformers version: 4.40.2
[2024-09-02T23:25:08.550Z] mlflow version: 2.16.0
[2024-09-02T23:25:08.550Z] pynrrd version: 1.0.0
[2024-09-02T23:25:08.550Z] clearml version: 1.16.4
[2024-09-02T23:25:08.550Z] 
[2024-09-02T23:25:08.550Z] For details about installing the optional dependencies, please visit:
[2024-09-02T23:25:08.550Z]     https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies
[2024-09-02T23:25:08.550Z] 
[2024-09-02T23:25:10.436Z] papermill  --progress-bar --log-output -k python3
[2024-09-02T23:25:10.690Z] /usr/local/lib/python3.10/dist-packages/papermill/iorw.py:149: UserWarning: the file is not specified with any extension : -
[2024-09-02T23:25:10.690Z]   warnings.warn(f"the file is not specified with any extension : {os.path.basename(path)}")
[2024-09-02T23:26:21.391Z] 
Executing:   0%|          | 0/19 [00:00<?, ?cell/s]
Executing:   5%|▌         | 1/19 [00:00<00:15,  1.15cell/s]
Executing:  32%|███▏      | 6/19 [00:19<00:43,  3.33s/cell]
Executing:  42%|████▏     | 8/19 [00:26<00:37,  3.41s/cell]
Executing:  53%|█████▎    | 10/19 [00:43<00:45,  5.07s/cell]
Executing:  63%|██████▎   | 12/19 [01:05<00:48,  6.90s/cell]
Executing:  68%|██████▊   | 13/19 [01:06<00:35,  5.88s/cell]
Executing:  89%|████████▉ | 17/19 [01:07<00:05,  2.97s/cell]
Executing:  89%|████████▉ | 17/19 [01:10<00:08,  4.13s/cell]
[2024-09-02T23:26:21.391Z] /usr/local/lib/python3.10/dist-packages/papermill/iorw.py:149: UserWarning: the file is not specified with any extension : -
[2024-09-02T23:26:21.391Z]   warnings.warn(f"the file is not specified with any extension : {os.path.basename(path)}")
[2024-09-02T23:26:21.391Z] Traceback (most recent call last):
[2024-09-02T23:26:21.391Z]   File "/usr/local/bin/papermill", line 8, in <module>
[2024-09-02T23:26:21.391Z]     sys.exit(papermill())
[2024-09-02T23:26:21.391Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
[2024-09-02T23:26:21.391Z]     return self.main(*args, **kwargs)
[2024-09-02T23:26:21.391Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
[2024-09-02T23:26:21.391Z]     rv = self.invoke(ctx)
[2024-09-02T23:26:21.391Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
[2024-09-02T23:26:21.391Z]     return ctx.invoke(self.callback, **ctx.params)
[2024-09-02T23:26:21.391Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
[2024-09-02T23:26:21.391Z]     return __callback(*args, **kwargs)
[2024-09-02T23:26:21.391Z]   File "/usr/local/lib/python3.10/dist-packages/click/decorators.py", line 33, in new_func
[2024-09-02T23:26:21.391Z]     return f(get_current_context(), *args, **kwargs)
[2024-09-02T23:26:21.391Z]   File "/usr/local/lib/python3.10/dist-packages/papermill/cli.py", line 235, in papermill
[2024-09-02T23:26:21.391Z]     execute_notebook(
[2024-09-02T23:26:21.391Z]   File "/usr/local/lib/python3.10/dist-packages/papermill/execute.py", line 131, in execute_notebook
[2024-09-02T23:26:21.391Z]     raise_for_execution_errors(nb, output_path)
[2024-09-02T23:26:21.391Z]   File "/usr/local/lib/python3.10/dist-packages/papermill/execute.py", line 251, in raise_for_execution_errors
[2024-09-02T23:26:21.391Z]     raise error
[2024-09-02T23:26:21.391Z] papermill.exceptions.PapermillExecutionError: 
[2024-09-02T23:26:21.392Z] ---------------------------------------------------------------------------
[2024-09-02T23:26:21.392Z] Exception encountered at "In [7]":
[2024-09-02T23:26:21.392Z] ---------------------------------------------------------------------------
[2024-09-02T23:26:21.392Z] KeyError                                  Traceback (most recent call last)
[2024-09-02T23:26:21.392Z] Cell In[7], line 9
[2024-09-02T23:26:21.392Z]       6 summary.set_index("Range", inplace=True)
[2024-09-02T23:26:21.392Z]       8 # Get the entries for training transforms only (to avoid nested ranges)
[2024-09-02T23:26:21.392Z] ----> 9 summary = summary.loc[transforms]
[2024-09-02T23:26:21.392Z]      11 # Nsys output column names are different in different versions,
[2024-09-02T23:26:21.392Z]      12 # so we need to find the corresponding columns
[2024-09-02T23:26:21.392Z]      13 avg_col = [c for c in summary.columns if c.startswith("Av")]
[2024-09-02T23:26:21.392Z] 
[2024-09-02T23:26:21.392Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexing.py:1191, in _LocationIndexer.__getitem__(self, key)
[2024-09-02T23:26:21.392Z]    1189 maybe_callable = com.apply_if_callable(key, self.obj)
[2024-09-02T23:26:21.392Z]    1190 maybe_callable = self._check_deprecated_callable_usage(key, maybe_callable)
[2024-09-02T23:26:21.392Z] -> 1191 return self._getitem_axis(maybe_callable, axis=axis)
[2024-09-02T23:26:21.392Z] 
[2024-09-02T23:26:21.392Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexing.py:1420, in _LocIndexer._getitem_axis(self, key, axis)
[2024-09-02T23:26:21.392Z]    1417     if hasattr(key, "ndim") and key.ndim > 1:
[2024-09-02T23:26:21.392Z]    1418         raise ValueError("Cannot index with multidimensional key")
[2024-09-02T23:26:21.392Z] -> 1420     return self._getitem_iterable(key, axis=axis)
[2024-09-02T23:26:21.392Z]    1422 # nested tuple slicing
[2024-09-02T23:26:21.392Z]    1423 if is_nested_tuple(key, labels):
[2024-09-02T23:26:21.392Z] 
[2024-09-02T23:26:21.392Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexing.py:1360, in _LocIndexer._getitem_iterable(self, key, axis)
[2024-09-02T23:26:21.392Z]    1357 self._validate_key(key, axis)
[2024-09-02T23:26:21.392Z]    1359 # A collection of keys
[2024-09-02T23:26:21.392Z] -> 1360 keyarr, indexer = self._get_listlike_indexer(key, axis)
[2024-09-02T23:26:21.392Z]    1361 return self.obj._reindex_with_indexers(
[2024-09-02T23:26:21.392Z]    1362     {axis: [keyarr, indexer]}, copy=True, allow_dups=True
[2024-09-02T23:26:21.392Z]    1363 )
[2024-09-02T23:26:21.392Z] 
[2024-09-02T23:26:21.392Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexing.py:1558, in _LocIndexer._get_listlike_indexer(self, key, axis)
[2024-09-02T23:26:21.392Z]    1555 ax = self.obj._get_axis(axis)
[2024-09-02T23:26:21.392Z]    1556 axis_name = self.obj._get_axis_name(axis)
[2024-09-02T23:26:21.392Z] -> 1558 keyarr, indexer = ax._get_indexer_strict(key, axis_name)
[2024-09-02T23:26:21.392Z]    1560 return keyarr, indexer
[2024-09-02T23:26:21.392Z] 
[2024-09-02T23:26:21.392Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py:6200, in Index._get_indexer_strict(self, key, axis_name)
[2024-09-02T23:26:21.392Z]    6197 else:
[2024-09-02T23:26:21.392Z]    6198     keyarr, indexer, new_indexer = self._reindex_non_unique(keyarr)
[2024-09-02T23:26:21.392Z] -> 6200 self._raise_if_missing(keyarr, indexer, axis_name)
[2024-09-02T23:26:21.392Z]    6202 keyarr = self.take(indexer)
[2024-09-02T23:26:21.392Z]    6203 if isinstance(key, Index):
[2024-09-02T23:26:21.392Z]    6204     # GH 42790 - Preserve name from an Index
[2024-09-02T23:26:21.392Z] 
[2024-09-02T23:26:21.392Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py:6249, in Index._raise_if_missing(self, key, indexer, axis_name)
[2024-09-02T23:26:21.392Z]    6247 if nmissing:
[2024-09-02T23:26:21.392Z]    6248     if nmissing == len(indexer):
[2024-09-02T23:26:21.392Z] -> 6249         raise KeyError(f"None of [{key}] are in the [{axis_name}]")
[2024-09-02T23:26:21.392Z]    6251     not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique())
[2024-09-02T23:26:21.392Z]    6252     raise KeyError(f"{not_found} not in index")
[2024-09-02T23:26:21.392Z] 
[2024-09-02T23:26:21.392Z] KeyError: "None of [Index(['ToTensord', 'Lambdad', 'GridSplitd', 'TorchVisiond_ColorJitter',\n       'ToNumpyd', 'RandFlipd', 'RandRotate90d', 'CastToTyped', 'RandZoomd',\n       'ScaleIntensityRanged', 'ToTensord_2', 'Activationsd', 'AsDiscreted'],\n      dtype='object', name='Range')] are in the [index]"