Project-MONAI / Project-MONAI/MONAILabel
Change of ROI size causes "Application startup failed" error
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 891
- Forks
- 269
- Avg merge
- 15h 41m
- Merged PRs (30d)
- 1
Description
Discussed in https://github.com/Project-MONAI/MONAILabel/discussions/1534
Originally posted by niklu-igloo August 29, 2023
Hi,
my name is Nicholas and I want to change the ROI size as adviced by @diazandr3s on the Discussion https://github.com/Project-MONAI/MONAILabel/discussions/943. I have encountered a problem when I modify /lib/configs/localization_spine.py script and I change the parameter "self.roi_size" to (48, 48, 48) on line 74 (https://github.com/Project-MONAI/MONAILabel/blob/720864189a61a3952cd533ca02ff03b59c33a8f0/sample-apps/radiology/lib/configs/localization_spine.py#L74C9-L74C80). Here is the resulting error I get once I start monailabel after I saved the modified python script:
(monai) $MY_USER:~/$FOLDER$ monailabel start_server --app radiology5 --studies $STUDY --conf models localization_spine
Using PYTHONPATH=/anaconda/envs:
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: version = False
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: app = /$FOLDER/radiology5
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: studies = $STUDY
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: verbose = INFO
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: conf = [['models', 'localization_spine']]
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: host = 0.0.0.0
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: port = 8000
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: uvicorn_app = monailabel.app:app
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: ssl_keyfile = None
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: ssl_certfile = None
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: ssl_keyfile_password = None
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: ssl_ca_certs = None
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: workers = None
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: limit_concurrency = None
[2023-08-29 11:34:52,439] [21627] [MainThread] [INFO] (__main__:285) - USING:: access_log = False
[2023-08-29 11:34:52,440] [21627] [MainThread] [INFO] (__main__:285) - USING:: root_path = /
[2023-08-29 11:34:52,440] [21627] [MainThread] [INFO] (__main__:285) - USING:: log_level = info
[2023-08-29 11:34:52,440] [21627] [MainThread] [INFO] (__main__:285) - USING:: log_config = None
[2023-08-29 11:34:52,440] [21627] [MainThread] [INFO] (__main__:285) - USING:: dryrun = False
[2023-08-29 11:34:52,440] [21627] [MainThread] [INFO] (__main__:285) - USING:: action = start_server
[2023-08-29 11:34:52,440] [21627] [MainThread] [INFO] (__main__:296) -
Allow Origins: ['*']
[2023-08-29 11:34:53,045] [21627] [MainThread] [INFO] (uvicorn.error:74) - Started server process [21627]
[2023-08-29 11:34:53,045] [21627] [MainThread] [INFO] (uvicorn.error:48) - Waiting for application startup.
[2023-08-29 11:34:53,045] [21627] [MainThread] [INFO] (monailabel.interfaces.utils.app:37) - Initializing App from: /$FOLDER/radiology5; studies: $STUDY; conf: {'models': 'localization_spine'}
[2023-08-29 11:34:53,512] [21627] [MainThread] [ERROR] (uvicorn.error:123) - Traceback (most recent call last):
File "/anaconda/envs/monai/lib/python3.8/site-packages/starlette/routing.py", line 677, in lifespan
async with self.lifespan_context(app) as maybe_state:
File "/anaconda/envs/monai/lib/python3.8/site-packages/starlette/routing.py", line 566, in __aenter__
await self._router.startup()
File "/anaconda/envs/monai/lib/python3.8/site-packages/starlette/routing.py", line 654, in startup
await handler()
File "/anaconda/envs/monai/lib/python3.8/site-packages/monailabel/app.py", line 108, in startup_event
instance = app_instance()
File "/anaconda/envs/monai/lib/python3.8/site-packages/monailabel/interfaces/utils/app.py", line 43, in app_instance
c = get_class_of_subclass_from_file("main", main_py, "MONAILabelApp")
File "/anaconda/envs/monai/lib/python3.8/site-packages/monailabel/utils/others/class_utils.py", line 75, in get_class_of_subclass_from_file
return get_class_of_subclass(module_from_file(module_name, file_path), class_c)
File "/anaconda/envs/monai/lib/python3.8/site-packages/monailabel/utils/others/class_utils.py", line 45, in module_from_file
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "$FOLDER/radiology5/main.py", line 18, in <module>
from lib.activelearning import Last
ImportError: cannot import name 'Last' from 'lib.activelearning' (unknown location)
[2023-08-29 11:34:53,512] [21627] [MainThread] [ERROR] (uvicorn.error:59) - Application startup failed. Exiting.
Could you please tell me if why this change doesn't seem to be applied and why I cannot let the model run anymore?
Thank you.
I wish all a good day,
Nicholas
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with sample-apps/radiology/lib/configs/localization_spine.py at the self.roi_size setting, then inspect the radiology app's main.py and the lib.activelearning import shown in the traceback. Run the provided monailabel start_server command and determine whether changing the ROI size causes or merely exposes the missing Last import; done means the application starts successfully with the requested ROI size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100