MONAI error: cannot import name

When I run (in Windows 10):

monailabel start_server --app monaibundle --studies Task09_Spleen/imagesTr --conf models renalStructures_UNEST_segmentation

I get:

Using PYTHONPATH=C:\Users\Gene\AppData\Local\Programs\Python;C:\Users\Gene\AppData\Local\Programs\Python\Python39;
“”
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: version = False
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: app = C:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monaibundle
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: studies = C:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\Task09_Spleen\imagesTr
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: verbose = INFO
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: conf = [[‘models’, ‘renalStructures_UNEST_segmentation’]]
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: host = 0.0.0.0
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: port = 8000
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: uvicorn_app = monailabel.app:app
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: ssl_keyfile = None
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: ssl_certfile = None
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: ssl_keyfile_password = None
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: ssl_ca_certs = None
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: workers = None
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: limit_concurrency = None
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: access_log = False
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: log_config = None
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: dryrun = False
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:276) - USING:: action = start_server
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_API_STR =
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_PROJECT_NAME = MONAILabel
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_APP_DIR =
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_STUDIES =
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_AUTH_ENABLE = False
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_AUTH_DB =
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_APP_CONF = ‘{}’
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_TASKS_TRAIN = True
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_TASKS_STRATEGY = True
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_TASKS_SCORING = True
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_TASKS_BATCH_INFER = True
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE =
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_URL =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_USERNAME =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_PASSWORD =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_API_KEY =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_CACHE_PATH =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_PROJECT =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_ASSET_PATH =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_DSA_ANNOTATION_GROUPS =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_USERNAME =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_PASSWORD =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_CACHE_PATH =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_QIDO_PREFIX = None
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_WADO_PREFIX = None
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_STOW_PREFIX = None
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_FETCH_BY_FRAME = False
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_CONVERT_TO_NIFTI = True
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_SEARCH_FILTER = ‘{“Modality”: “CT”}’
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_CACHE_EXPIRY = 180
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_PROXY_TIMEOUT = 30.0
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_READ_TIMEOUT = 5.0
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_AUTO_RELOAD = True
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_READ_ONLY = False
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_DATASTORE_FILE_EXT = '["
.nii.gz", “.nii", ".nrrd”, “.jpg", ".png”, “.tif", ".svs”, ".xml"]’
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_SERVER_PORT = 8000
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_CORS_ORIGINS = ‘[]’
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_SESSIONS = True
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_SESSION_PATH =
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_SESSION_EXPIRY = 3600
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_INFER_CONCURRENCY = -1
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_INFER_TIMEOUT = 600
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_TRACKING_ENABLED = True
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_TRACKING_URI =
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_ZOO_SOURCE = github
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_ZOO_REPO = Project-MONAI/model-zoo/hosting_storage_v1
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_ZOO_AUTH_TOKEN = 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
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] (main:280) - ENV SETTINGS:: MONAI_LABEL_AUTO_UPDATE_SCORING = True
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] (main:281) -
Traceback (most recent call last):
File “C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\main.py”, line 342, in
Main().run()
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\main.py”, line 133, in run
self.action_start_server(args)
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\main.py”, line 234, in action_start_server
uvicorn.run(
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\main.py”, line 463, in run
server.run()
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\server.py”, line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File “C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\asyncio\runners.py”, line 44, in run
return loop.run_until_complete(main)
File “C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\asyncio\base_events.py”, line 647, in run_until_complete
return future.result()
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\server.py”, line 67, in serve
config.load()
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\config.py”, line 458, in load
self.loaded_app = import_from_string(self.app)
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\importer.py”, line 24, in import_from_string
raise exc from None
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\importer.py”, line 21, in import_from_string
module = importlib.import_module(module_str)
File "C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1030, in _gcd_import
File “”, line 1007, in _find_and_load
File “”, line 986, in _find_and_load_unlocked
File “”, line 680, in _load_unlocked
File “”, line 850, in exec_module
File “”, line 228, in call_with_frames_removed
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\app.py”, line 23, in
from monailabel.endpoints import (
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\endpoints\activelearning.py”, line 19, in
from monailabel.interfaces.app import MONAILabelApp
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\interfaces\app.py”, line 38, in
from monailabel.datastore.dicom import DICOMwebClientX, DICOMWebDatastore
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\datastore\dicom.py”, line 26, in
from monailabel.datastore.utils.convert import binary_to_image, dicom_to_nifti, nifti_to_dicom_seg
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\datastore\utils\convert.py”, line 24, in
from monai.data import nifty_writer
ImportError: cannot import name ‘nifty_writer’ from ‘monai.data’ (c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monai\data_init
.py)

I don’t know what to do next. I installed monailabel and then monai-weekly to avoid the hardcoded site request issue with running the server in Windows.

Gene

I installed monailabel-weekly…

Did you install MonaiLabel as described here and which works for most use cases?

What did you do differently?

Thank you for your assistance!

I was following directions from another web site, so I started over and used your directions. It got me this far:

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.github.com/repos/Project-MONAI\model-zoo/releases

The "" is the problem. I believe I read about this Windows specific error and that the solution was to install monailabel-weekly. I don’t know if this is what I should do and I don’t want to mess up what has gotten me this far. Do you have a suggestion?

Thanks again.

Gene

At which installation stage/command from the script (link above) does this happen?

PS C:\Users\Gene> monailabel datasets --download --name Task09_Spleen --output datasets
Using PYTHONPATH=C:\Users\Gene\MONAILabel;
“”
Directory already exists: datasets\Task09_Spleen
PS C:\Users\Gene> monailabel start_server --app monaibundle --studies Task09_Spleen/imagesTr --conf models renalStructures_UNEST_segmentation
Using PYTHONPATH=C:\Users\Gene\MONAILabel;
“”
2023-03-08 08:56:00,220 - USING:: version = False
2023-03-08 08:56:00,220 - USING:: app = C:\Users\Gene\monaibundle
2023-03-08 08:56:00,221 - USING:: studies = C:\Users\Gene\Task09_Spleen\imagesTr
2023-03-08 08:56:00,222 - USING:: verbose = INFO
2023-03-08 08:56:00,222 - USING:: conf = [[‘models’, ‘renalStructures_UNEST_segmentation’]]
2023-03-08 08:56:00,222 - USING:: host = 0.0.0.0
2023-03-08 08:56:00,223 - USING:: port = 8000
2023-03-08 08:56:00,223 - USING:: uvicorn_app = monailabel.app:app
2023-03-08 08:56:00,223 - USING:: ssl_keyfile = None
2023-03-08 08:56:00,224 - USING:: ssl_certfile = None
2023-03-08 08:56:00,224 - USING:: ssl_keyfile_password = None
2023-03-08 08:56:00,224 - USING:: ssl_ca_certs = None
2023-03-08 08:56:00,225 - USING:: workers = None
2023-03-08 08:56:00,225 - USING:: limit_concurrency = None
2023-03-08 08:56:00,225 - USING:: access_log = False
2023-03-08 08:56:00,226 - USING:: log_config = None
2023-03-08 08:56:00,226 - USING:: dryrun = False
2023-03-08 08:56:00,226 - USING:: action = start_server
2023-03-08 08:56:00,227 - ENV SETTINGS:: MONAI_LABEL_API_STR =
2023-03-08 08:56:00,227 - ENV SETTINGS:: MONAI_LABEL_PROJECT_NAME = MONAILabel
2023-03-08 08:56:00,227 - ENV SETTINGS:: MONAI_LABEL_APP_DIR =
2023-03-08 08:56:00,228 - ENV SETTINGS:: MONAI_LABEL_STUDIES =
2023-03-08 08:56:00,228 - ENV SETTINGS:: MONAI_LABEL_AUTH_ENABLE = False
2023-03-08 08:56:00,229 - ENV SETTINGS:: MONAI_LABEL_AUTH_DB =
2023-03-08 08:56:00,229 - ENV SETTINGS:: MONAI_LABEL_APP_CONF = ‘{}’
2023-03-08 08:56:00,230 - ENV SETTINGS:: MONAI_LABEL_TASKS_TRAIN = True
2023-03-08 08:56:00,230 - ENV SETTINGS:: MONAI_LABEL_TASKS_STRATEGY = True
2023-03-08 08:56:00,230 - ENV SETTINGS:: MONAI_LABEL_TASKS_SCORING = True
2023-03-08 08:56:00,231 - ENV SETTINGS:: MONAI_LABEL_TASKS_BATCH_INFER = True
2023-03-08 08:56:00,231 - ENV SETTINGS:: MONAI_LABEL_DATASTORE =
2023-03-08 08:56:00,231 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_URL =
2023-03-08 08:56:00,231 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_USERNAME =
2023-03-08 08:56:00,232 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_PASSWORD =
2023-03-08 08:56:00,232 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_API_KEY =
2023-03-08 08:56:00,232 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_CACHE_PATH =
2023-03-08 08:56:00,233 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_PROJECT =
2023-03-08 08:56:00,233 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_ASSET_PATH =
2023-03-08 08:56:00,233 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_DSA_ANNOTATION_GROUPS =
2023-03-08 08:56:00,234 - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_USERNAME =
2023-03-08 08:56:00,236 - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_PASSWORD =
2023-03-08 08:56:00,236 - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_CACHE_PATH =
2023-03-08 08:56:00,236 - ENV SETTINGS:: MONAI_LABEL_QIDO_PREFIX = None
2023-03-08 08:56:00,237 - ENV SETTINGS:: MONAI_LABEL_WADO_PREFIX = None
2023-03-08 08:56:00,237 - ENV SETTINGS:: MONAI_LABEL_STOW_PREFIX = None
2023-03-08 08:56:00,237 - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_FETCH_BY_FRAME = False
2023-03-08 08:56:00,238 - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_CONVERT_TO_NIFTI = True
2023-03-08 08:56:00,238 - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_SEARCH_FILTER = ‘{“Modality”: “CT”}’
2023-03-08 08:56:00,238 - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_CACHE_EXPIRY = 180
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_PROXY_TIMEOUT = 30.0
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI_LABEL_DICOMWEB_READ_TIMEOUT = 5.0
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_AUTO_RELOAD = True
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_READ_ONLY = False
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI_LABEL_DATASTORE_FILE_EXT = ‘[“.nii.gz", ".nii”, “.nrrd", ".jpg”, “.png", ".tif”, “.svs", ".xml”]’
2023-03-08 08:56:00,240 - ENV SETTINGS:: MONAI_LABEL_SERVER_PORT = 8000
2023-03-08 08:56:00,240 - ENV SETTINGS:: MONAI_LABEL_CORS_ORIGINS = ‘
2023-03-08 08:56:00,240 - ENV SETTINGS:: MONAI_LABEL_SESSIONS = True
2023-03-08 08:56:00,241 - ENV SETTINGS:: MONAI_LABEL_SESSION_PATH =
2023-03-08 08:56:00,241 - ENV SETTINGS:: MONAI_LABEL_SESSION_EXPIRY = 3600
2023-03-08 08:56:00,241 - ENV SETTINGS:: MONAI_LABEL_INFER_CONCURRENCY = -1
2023-03-08 08:56:00,242 - ENV SETTINGS:: MONAI_LABEL_INFER_TIMEOUT = 600
2023-03-08 08:56:00,242 - ENV SETTINGS:: MONAI_LABEL_TRACKING_ENABLED = True
2023-03-08 08:56:00,242 - ENV SETTINGS:: MONAI_LABEL_TRACKING_URI =
2023-03-08 08:56:00,243 - ENV SETTINGS:: MONAI_ZOO_SOURCE = github
2023-03-08 08:56:00,243 - ENV SETTINGS:: MONAI_ZOO_REPO = Project-MONAI/model-zoo/hosting_storage_v1
2023-03-08 08:56:00,243 - ENV SETTINGS:: MONAI_ZOO_AUTH_TOKEN = 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
2023-03-08 08:56:00,244 - ENV SETTINGS:: MONAI_LABEL_AUTO_UPDATE_SCORING = True
2023-03-08 08:56:00,244 -
Allow Origins: [‘*’]
[2023-03-08 08:56:01,589] [9072] [MainThread] [INFO] (uvicorn.error:75) - Started server process [9072]
[2023-03-08 08:56:01,589] [9072] [MainThread] [INFO] (uvicorn.error:45) - Waiting for application startup.
[2023-03-08 08:56:01,591] [9072] [MainThread] [INFO] (monailabel.interfaces.utils.app:37) - Initializing App from: C:\Users\Gene\monaibundle; studies: C:\Users\Gene\Task09_Spleen\imagesTr; conf: {‘models’: ‘renalStructures_UNEST_segmentation’}
[2023-03-08 08:56:01,660] [9072] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for MONAILabelApp Found: <class ‘main.MyApp’>
[2023-03-08 08:56:05,915] [9072] [MainThread] [INFO] (monailabel.utils.others.generic:303) - +++ Adding Bundle from Zoo: renalStructures_UNEST_segmentation => C:\Users\Gene\monaibundle\model\renalStructures_UNEST_segmentation
2023-03-08 08:56:05,915 - INFO - — input summary of monai.bundle.scripts.download —
2023-03-08 08:56:05,916 - INFO - > name: ‘renalStructures_UNEST_segmentation’
2023-03-08 08:56:05,917 - INFO - > bundle_dir: ‘C:\Users\Gene\monaibundle\model’
2023-03-08 08:56:05,918 - INFO - > source: ‘github’
2023-03-08 08:56:05,918 - INFO - > repo: ‘Project-MONAI/model-zoo/hosting_storage_v1’
2023-03-08 08:56:05,919 - INFO - > remove_prefix: ‘monai_’
2023-03-08 08:56:05,919 - INFO - > progress: True
2023-03-08 08:56:05,920 - INFO - —

[2023-03-08 08:56:06,060] [9072] [MainThread] [ERROR] (uvicorn.error:119) - Traceback (most recent call last):
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py”, line 635, in lifespan
async with self.lifespan_context(app):
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py”, line 530, in aenter
await self.router.startup()
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py”, line 612, in startup
await handler()
File “C:\Users\Gene\MONAILabel\monailabel\app.py”, line 106, in startup_event
instance = app_instance()
File “C:\Users\Gene\MONAILabel\monailabel\interfaces\utils\app.py”, line 50, in app_instance
app = c(app_dir=app_dir, studies=studies, conf=conf)
File “C:\Users\Gene\monaibundle\main.py”, line 36, in init
self.models = get_bundle_models(app_dir, conf)
File “C:\Users\Gene\MONAILabel\monailabel\utils\others\generic.py”, line 307, in get_bundle_models
download(name=name, version=version, bundle_dir=model_dir, source=zoo_source, repo=zoo_repo)
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\monai\bundle\scripts.py”, line 302, in download
version
= get_latest_bundle_version(source=source, name=name_, repo=repo_)
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\monai\bundle\scripts.py”, line 185, in _get_latest_bundle_version
return get_bundle_versions(name, repo=os.path.join(repo_owner, repo_name), tag=tag_name)[“latest_version”]
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\monai\bundle\scripts.py”, line 520, in get_bundle_versions
bundles_info = _get_all_bundles_info(repo=repo, tag=tag, auth_token=auth_token)
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\monai\bundle\scripts.py”, line 434, in _get_all_bundles_info
resp.raise_for_status()
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\requests\models.py”, line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.github.com/repos/Project-MONAI\model-zoo/releases

[2023-03-08 08:56:06,061] [9072] [MainThread] [ERROR] (uvicorn.error:56) - Application startup failed. Exiting.

I can reproduce that.
Have you tried the radiology apps? Do you rely on monaibundle?

This is where I confess my ignorance… I want to use Slicer3d with a radiology app and was excited when I saw the kidney study because I have kidney cancer and want to learn as much as I can. Is there another way to run this study?

Is there a way to download the models and then refer to them on my PC vs getting them from github ?

Sorry to hear that. Good luck.

Maybe @diazandr3s can comment.

1 Like

Give it some time. You should get it going.
I would recommend studying kidney (and related organs/tissues) anatomy.
Also checkout this:

Best of luck

I figured it out. There are environment variables (MONI_ZOO_SOURCE = ‘’ and MONI_ZOO_REPO = ) that seems to be working.

1 Like

Could you write a short passage that I could add to the installation script? Thank you.

How’s this?

IF

the git api request for a model fails due to an improperly formatted URL

(for example https://api.github.com/repos/Project-MONAI\model-zoo/releases)

THEN

Step 1: The model “.zip” file can be downloaded (via web browser, for example) with a properly formatted version of the URL (replace '' with ‘/’) and then expanded into a folder on your PC.

Step 2: Set values for two environment variable the server will use as an override:

  • $Env:MONAI_ZOO_SOURCE = ‘local’
  • $Env:MONAI_ZOO_REPO = < folder name >

Step 3: Start monailabel server

1 Like

Also, “git” was not installed on my Win 10 pro. “winget install git.git” made it available.

Thanks for the ping @rbumm
I’d suggest asking questions or reporting any issues on using MONAI Bundle or models from the model Zoo directly on the main GitHub repo (GitHub - Project-MONAI/model-zoo: MONAI Model Zoo that hosts models in the MONAI Bundle format.). The developers will answer you within hours :slight_smile:

1 Like