Project-MONAI / tutorials

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

AttributeError: 'LayerFactory' object has no attribute 'factories' #1557

Closed KumoLiu closed 1 year ago

KumoLiu commented 1 year ago
[2023-10-28T23:34:56.590Z] Traceback (most recent call last):
[2023-10-28T23:34:56.590Z]   File "/usr/local/bin/papermill", line 8, in <module>
[2023-10-28T23:34:56.590Z]     sys.exit(papermill())
[2023-10-28T23:34:56.590Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
[2023-10-28T23:34:56.590Z]     return self.main(*args, **kwargs)
[2023-10-28T23:34:56.590Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
[2023-10-28T23:34:56.590Z]     rv = self.invoke(ctx)
[2023-10-28T23:34:56.590Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
[2023-10-28T23:34:56.590Z]     return ctx.invoke(self.callback, **ctx.params)
[2023-10-28T23:34:56.590Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
[2023-10-28T23:34:56.590Z]     return __callback(*args, **kwargs)
[2023-10-28T23:34:56.590Z]   File "/usr/local/lib/python3.10/dist-packages/click/decorators.py", line 33, in new_func
[2023-10-28T23:34:56.590Z]     return f(get_current_context(), *args, **kwargs)
[2023-10-28T23:34:56.590Z]   File "/usr/local/lib/python3.10/dist-packages/papermill/cli.py", line 250, in papermill
[2023-10-28T23:34:56.590Z]     execute_notebook(
[2023-10-28T23:34:56.590Z]   File "/usr/local/lib/python3.10/dist-packages/papermill/execute.py", line 128, in execute_notebook
[2023-10-28T23:34:56.590Z]     raise_for_execution_errors(nb, output_path)
[2023-10-28T23:34:56.590Z]   File "/usr/local/lib/python3.10/dist-packages/papermill/execute.py", line 232, in raise_for_execution_errors
[2023-10-28T23:34:56.590Z]     raise error
[2023-10-28T23:34:56.590Z] papermill.exceptions.PapermillExecutionError: 
[2023-10-28T23:34:56.590Z] ---------------------------------------------------------------------------
[2023-10-28T23:34:56.590Z] Exception encountered at "In [9]":
[2023-10-28T23:34:56.590Z] ---------------------------------------------------------------------------
[2023-10-28T23:34:56.590Z] AttributeError                            Traceback (most recent call last)
[2023-10-28T23:34:56.590Z] Cell In[9], line 1
[2023-10-28T23:34:56.590Z] ----> 1 monai.networks.layers.factories.Norm.factories.keys()
[2023-10-28T23:34:56.590Z] 
[2023-10-28T23:34:56.590Z] File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/networks/layers/factories.py:160, in LayerFactory.__getattr__(self, key)
[2023-10-28T23:34:56.590Z]     157 if key in self.components:
[2023-10-28T23:34:56.590Z]     158     return key
[2023-10-28T23:34:56.590Z] --> 160 return super().__getattribute__(key)
[2023-10-28T23:34:56.590Z] 
[2023-10-28T23:34:56.590Z] AttributeError: 'LayerFactory' object has no attribute 'factories'
ericspod commented 1 year ago

@marksgraham This is related to our updates of the factory class I believe.

marksgraham commented 1 year ago

Yes I searched monai for references that needed updating by not the tutorials! Will fix now

ericspod commented 1 year ago

Thanks! We should check bundles, MONAI Label, etc. as well.

marksgraham commented 1 year ago

The other repos look OK to me