Skip to content

auto3dseg notebooks error #1306

Closed
Closed
@wyli

Description

@wyli
[2023-04-12T01:53:09.890Z] Running ./auto3dseg/notebooks/auto3dseg_autorunner_ref_api.ipynb
[2023-04-12T01:53:09.890Z] Checking PEP8 compliance...
[2023-04-12T01:53:10.449Z] Running notebook...
[2023-04-12T01:53:10.449Z] Before:
[2023-04-12T01:53:10.449Z]     "max_epochs = 2  # change epoch number to 2 to cut down the notebook running time\n",
[2023-04-12T01:53:10.449Z] After:
[2023-04-12T01:53:10.449Z]     "max_epochs = 1  # change epoch number to 2 to cut down the notebook running time\n",
[2023-04-12T01:53:14.606Z] MONAI version: 1.2.0rc2+44.g6a7f35b7
[2023-04-12T01:53:14.606Z] Numpy version: 1.22.2
[2023-04-12T01:53:14.606Z] Pytorch version: 1.10.2+cu102
[2023-04-12T01:53:14.606Z] MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
[2023-04-12T01:53:14.606Z] MONAI rev id: 6a7f35b7e271cdf3b2c763ae35acf4ab25d85d23
[2023-04-12T01:53:14.606Z] MONAI __file__: /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/__init__.py
[2023-04-12T01:53:14.606Z] 
[2023-04-12T01:53:14.606Z] Optional dependencies:
[2023-04-12T01:53:14.606Z] Pytorch Ignite version: 0.4.11
[2023-04-12T01:53:14.606Z] ITK version: 5.3.0
[2023-04-12T01:53:14.606Z] Nibabel version: 5.1.0
[2023-04-12T01:53:14.606Z] scikit-image version: 0.19.3
[2023-04-12T01:53:14.606Z] Pillow version: 7.0.0
[2023-04-12T01:53:14.606Z] Tensorboard version: 2.9.0
[2023-04-12T01:53:14.606Z] gdown version: 4.7.1
[2023-04-12T01:53:14.606Z] TorchVision version: 0.11.3+cu102
[2023-04-12T01:53:14.606Z] tqdm version: 4.65.0
[2023-04-12T01:53:14.606Z] lmdb version: 1.4.1
[2023-04-12T01:53:14.606Z] psutil version: 5.9.4
[2023-04-12T01:53:14.606Z] pandas version: 1.1.5
[2023-04-12T01:53:14.606Z] einops version: 0.6.0
[2023-04-12T01:53:14.606Z] transformers version: 4.21.3
[2023-04-12T01:53:14.606Z] mlflow version: 2.2.2
[2023-04-12T01:53:14.606Z] pynrrd version: 1.0.0
[2023-04-12T01:53:14.606Z] 
[2023-04-12T01:53:14.606Z] For details about installing the optional dependencies, please visit:
[2023-04-12T01:53:14.606Z]     https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies
[2023-04-12T01:53:14.606Z] 
[2023-04-12T01:53:16.491Z] papermill  --progress-bar -k python3
[2023-04-12T01:53:16.746Z] /usr/local/lib/python3.8/dist-packages/papermill/iorw.py:153: UserWarning: the file is not specified with any extension : -
[2023-04-12T01:53:16.746Z]   warnings.warn(
[2023-04-12T01:53:35.647Z] 
Executing:   0%|          | 0/24 [00:00<?, ?cell/s]
Executing:   4%|▍         | 1/24 [00:01<00:31,  1.35s/cell]
Executing:  12%|█▎        | 3/24 [00:06<00:44,  2.14s/cell]
Executing:  21%|██        | 5/24 [00:09<00:36,  1.93s/cell]
Executing:  29%|██▉       | 7/24 [00:11<00:24,  1.46s/cell]
Executing:  46%|████▌     | 11/24 [00:15<00:16,  1.23s/cell]
Executing:  58%|█████▊    | 14/24 [00:17<00:10,  1.00s/cell]
Executing:  88%|████████▊ | 21/24 [00:17<00:01,  2.08cell/s]
Executing:  88%|████████▊ | 21/24 [00:19<00:02,  1.10cell/s]
[2023-04-12T01:53:35.649Z] /usr/local/lib/python3.8/dist-packages/papermill/iorw.py:153: UserWarning: the file is not specified with any extension : -
[2023-04-12T01:53:35.649Z]   warnings.warn(
[2023-04-12T01:53:35.649Z] Traceback (most recent call last):
[2023-04-12T01:53:35.649Z]   File "/usr/local/bin/papermill", line 8, in <module>
[2023-04-12T01:53:35.649Z]     sys.exit(papermill())
[2023-04-12T01:53:35.649Z]   File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1130, in __call__
[2023-04-12T01:53:35.649Z]     return self.main(*args, **kwargs)
[2023-04-12T01:53:35.649Z]   File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1055, in main
[2023-04-12T01:53:35.649Z]     rv = self.invoke(ctx)
[2023-04-12T01:53:35.649Z]   File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1404, in invoke
[2023-04-12T01:53:35.649Z]     return ctx.invoke(self.callback, **ctx.params)
[2023-04-12T01:53:35.649Z]   File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 760, in invoke
[2023-04-12T01:53:35.649Z]     return __callback(*args, **kwargs)
[2023-04-12T01:53:35.649Z]   File "/usr/local/lib/python3.8/dist-packages/click/decorators.py", line 26, in new_func
[2023-04-12T01:53:35.649Z]     return f(get_current_context(), *args, **kwargs)
[2023-04-12T01:53:35.649Z]   File "/usr/local/lib/python3.8/dist-packages/papermill/cli.py", line 250, in papermill
[2023-04-12T01:53:35.649Z]     execute_notebook(
[2023-04-12T01:53:35.649Z]   File "/usr/local/lib/python3.8/dist-packages/papermill/execute.py", line 128, in execute_notebook
[2023-04-12T01:53:35.649Z]     raise_for_execution_errors(nb, output_path)
[2023-04-12T01:53:35.649Z]   File "/usr/local/lib/python3.8/dist-packages/papermill/execute.py", line 232, in raise_for_execution_errors
[2023-04-12T01:53:35.649Z]     raise error
[2023-04-12T01:53:35.649Z] papermill.exceptions.PapermillExecutionError: 
[2023-04-12T01:53:35.649Z] ---------------------------------------------------------------------------
[2023-04-12T01:53:35.649Z] Exception encountered at "In [9]":
[2023-04-12T01:53:35.649Z] ---------------------------------------------------------------------------
[2023-04-12T01:53:35.649Z] AttributeError                            Traceback (most recent call last)
[2023-04-12T01:53:35.649Z] Cell In[9], line 4
[2023-04-12T01:53:35.649Z]       2 for task in history:
[2023-04-12T01:53:35.649Z]       3     for _, algo in task.items():
[2023-04-12T01:53:35.649Z] ----> 4         algo.train(train_param)  # can use default params by `algo.train()`
[2023-04-12T01:53:35.649Z]       5         acc = algo.get_score()
[2023-04-12T01:53:35.649Z]       6         algo_to_pickle(algo, template_path=algo.template_path, best_metrics=acc)
[2023-04-12T01:53:35.649Z] 
[2023-04-12T01:53:35.649Z] AttributeError: 'str' object has no attribute 'train'
[2023-04-12T01:56:38.481Z] Running ./auto3dseg/notebooks/hpo_optuna.ipynb
[2023-04-12T01:56:38.481Z] Checking PEP8 compliance...
[2023-04-12T01:56:39.042Z] Running notebook...
[2023-04-12T01:56:39.042Z] Before:
[2023-04-12T01:56:39.042Z]     "max_epochs = 2\n",
[2023-04-12T01:56:39.042Z] After:
[2023-04-12T01:56:39.042Z]     "max_epochs = 1\n",
[2023-04-12T01:56:43.210Z] MONAI version: 1.2.0rc2+44.g6a7f35b7
[2023-04-12T01:56:43.210Z] Numpy version: 1.22.2
[2023-04-12T01:56:43.210Z] Pytorch version: 1.10.2+cu102
[2023-04-12T01:56:43.210Z] MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
[2023-04-12T01:56:43.210Z] MONAI rev id: 6a7f35b7e271cdf3b2c763ae35acf4ab25d85d23
[2023-04-12T01:56:43.210Z] MONAI __file__: /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/__init__.py
[2023-04-12T01:56:43.210Z] 
[2023-04-12T01:56:43.210Z] Optional dependencies:
[2023-04-12T01:56:43.210Z] Pytorch Ignite version: 0.4.11
[2023-04-12T01:56:43.210Z] ITK version: 5.3.0
[2023-04-12T01:56:43.210Z] Nibabel version: 5.1.0
[2023-04-12T01:56:43.210Z] scikit-image version: 0.19.3
[2023-04-12T01:56:43.210Z] Pillow version: 7.0.0
[2023-04-12T01:56:43.210Z] Tensorboard version: 2.9.0
[2023-04-12T01:56:43.210Z] gdown version: 4.7.1
[2023-04-12T01:56:43.210Z] TorchVision version: 0.11.3+cu102
[2023-04-12T01:56:43.210Z] tqdm version: 4.65.0
[2023-04-12T01:56:43.210Z] lmdb version: 1.4.1
[2023-04-12T01:56:43.210Z] psutil version: 5.9.4
[2023-04-12T01:56:43.210Z] pandas version: 1.1.5
[2023-04-12T01:56:43.210Z] einops version: 0.6.0
[2023-04-12T01:56:43.210Z] transformers version: 4.21.3
[2023-04-12T01:56:43.210Z] mlflow version: 2.2.2
[2023-04-12T01:56:43.210Z] pynrrd version: 1.0.0
[2023-04-12T01:56:43.210Z] 
[2023-04-12T01:56:43.210Z] For details about installing the optional dependencies, please visit:
[2023-04-12T01:56:43.210Z]     https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies
[2023-04-12T01:56:43.210Z] 
[2023-04-12T01:56:44.571Z] papermill  --progress-bar -k python3
[2023-04-12T01:56:45.130Z] /usr/local/lib/python3.8/dist-packages/papermill/iorw.py:153: UserWarning: the file is not specified with any extension : -
[2023-04-12T01:56:45.130Z]   warnings.warn(
[2023-04-12T01:57:02.519Z] 
Executing:   0%|          | 0/23 [00:00<?, ?cell/s]
Executing:   4%|▍         | 1/23 [00:01<00:32,  1.47s/cell]
Executing:  13%|█▎        | 3/23 [00:06<00:43,  2.16s/cell]
Executing:  22%|██▏       | 5/23 [00:09<00:35,  1.97s/cell]
Executing:  30%|███       | 7/23 [00:10<00:21,  1.32s/cell]
Executing:  57%|█████▋    | 13/23 [00:15<00:09,  1.01cell/s]
Executing:  91%|█████████▏| 21/23 [00:15<00:00,  2.11cell/s]
Executing:  91%|█████████▏| 21/23 [00:17<00:01,  1.21cell/s]
[2023-04-12T01:57:02.520Z] /usr/local/lib/python3.8/dist-packages/papermill/iorw.py:153: UserWarning: the file is not specified with any extension : -
[2023-04-12T01:57:02.520Z]   warnings.warn(
[2023-04-12T01:57:02.520Z] Traceback (most recent call last):
[2023-04-12T01:57:02.520Z]   File "/usr/local/bin/papermill", line 8, in <module>
[2023-04-12T01:57:02.520Z]     sys.exit(papermill())
[2023-04-12T01:57:02.520Z]   File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1130, in __call__
[2023-04-12T01:57:02.520Z]     return self.main(*args, **kwargs)
[2023-04-12T01:57:02.520Z]   File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1055, in main
[2023-04-12T01:57:02.520Z]     rv = self.invoke(ctx)
[2023-04-12T01:57:02.520Z]   File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1404, in invoke
[2023-04-12T01:57:02.520Z]     return ctx.invoke(self.callback, **ctx.params)
[2023-04-12T01:57:02.520Z]   File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 760, in invoke
[2023-04-12T01:57:02.520Z]     return __callback(*args, **kwargs)
[2023-04-12T01:57:02.520Z]   File "/usr/local/lib/python3.8/dist-packages/click/decorators.py", line 26, in new_func
[2023-04-12T01:57:02.520Z]     return f(get_current_context(), *args, **kwargs)
[2023-04-12T01:57:02.520Z]   File "/usr/local/lib/python3.8/dist-packages/papermill/cli.py", line 250, in papermill
[2023-04-12T01:57:02.520Z]     execute_notebook(
[2023-04-12T01:57:02.520Z]   File "/usr/local/lib/python3.8/dist-packages/papermill/execute.py", line 128, in execute_notebook
[2023-04-12T01:57:02.520Z]     raise_for_execution_errors(nb, output_path)
[2023-04-12T01:57:02.520Z]   File "/usr/local/lib/python3.8/dist-packages/papermill/execute.py", line 232, in raise_for_execution_errors
[2023-04-12T01:57:02.520Z]     raise error
[2023-04-12T01:57:02.520Z] papermill.exceptions.PapermillExecutionError: 
[2023-04-12T01:57:02.520Z] ---------------------------------------------------------------------------
[2023-04-12T01:57:02.520Z] Exception encountered at "In [10]":
[2023-04-12T01:57:02.520Z] ---------------------------------------------------------------------------
[2023-04-12T01:57:02.520Z] AttributeError                            Traceback (most recent call last)
[2023-04-12T01:57:02.520Z] Cell In[10], line 6
[2023-04-12T01:57:02.520Z]       2     def get_hyperparameters(self):
[2023-04-12T01:57:02.520Z]       3         return {"learning_rate": self.trial.suggest_float("learning_rate", 0.00001, 0.1)}
[2023-04-12T01:57:02.520Z] ----> 6 optuna_gen = OptunaGenLearningRate(algo=algo, params=override_param)
[2023-04-12T01:57:02.520Z] 
[2023-04-12T01:57:02.520Z] File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/apps/auto3dseg/hpo_gen.py:310, in OptunaGen.__init__(self, algo, params)
[2023-04-12T01:57:02.520Z]     308     self.obj_filename = algo_to_pickle(self.algo, template_path=self.algo.template_path)
[2023-04-12T01:57:02.520Z]     309 else:
[2023-04-12T01:57:02.520Z] --> 310     self.obj_filename = algo_to_pickle(self.algo)
[2023-04-12T01:57:02.520Z] 
[2023-04-12T01:57:02.520Z] File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/auto3dseg/utils.py:289, in algo_to_pickle(algo, **algo_meta_data)
[2023-04-12T01:57:02.520Z]     276 """
[2023-04-12T01:57:02.520Z]     277 Export the Algo object to pickle file
[2023-04-12T01:57:02.520Z]     278 
[2023-04-12T01:57:02.520Z]    (...)
[2023-04-12T01:57:02.520Z]     286     filename of the pickled Algo object
[2023-04-12T01:57:02.520Z]     287 """
[2023-04-12T01:57:02.520Z]     288 data = {"algo_bytes": pickle.dumps(algo)}
[2023-04-12T01:57:02.520Z] --> 289 pkl_filename = os.path.join(algo.get_output_path(), "algo_object.pkl")
[2023-04-12T01:57:02.520Z]     290 for k, v in algo_meta_data.items():
[2023-04-12T01:57:02.520Z]     291     data.update({k: v})
[2023-04-12T01:57:02.520Z] 
[2023-04-12T01:57:02.520Z] AttributeError: 'str' object has no attribute 'get_output_path'

cc @mingxin-zheng @Nic-Ma @myron

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions