Project-MONAI / Project-MONAI/MONAILabel

sample-apps/vista2d installation instructions incomplete

Open
#1,810 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
891
Forks
269
Avg merge
15h 41m
Merged PRs (30d)
1

Description

Describe the bug

I understand how to fix the following bug, but am reporting it since the instructions here need to be updated.

After running the instructions:

> monailabel apps --download --name vista2d --output apps
> pip install -r ./apps/vista2d/requirements.txt
> monailabel start_server --app apps/vista2d --studies datasets --conf models vista2d --conf preload true --conf skip_trainers true

Withe the contents of apps/vista2d/requirements.txt being:

# Copyright (c) MONAI Consortium
# Licensed under the Apache License Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#     http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing software
# distributed under the License is distributed on an AS IS BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
cellpose==3.0.8
natsort==8.4.0
roifile==2024.5.24
fastremap==1.15.0

I receive the following error, regarding missing dependencies:

Using PYTHONPATH=/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages:

[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: version = False
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: app = /home/ngogober/MONAILabel/apps/vista2d
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: studies = /home/ngogober/MONAILabel/datasets
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: verbose = INFO
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: conf = [['models', 'vista2d'], ['preload', 'true'], ['skip_trainers', 'true']]
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: host = 0.0.0.0
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: port = 8000
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: uvicorn_app = monailabel.app:app
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: ssl_keyfile = None
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: ssl_certfile = None
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: ssl_keyfile_password = None
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: ssl_ca_certs = None
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: workers = None
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: limit_concurrency = None
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: access_log = False
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: root_path =
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: log_level = info
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: log_config = None
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: dryrun = False
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:285) - USING:: action = start_server
[2025-01-30 19:24:13,982] [462579] [MainThread] [INFO] (__main__:296) -
Allow Origins: ['*']
[2025-01-30 19:24:14,591] [462579] [MainThread] [INFO] (uvicorn.error:83) - Started server process [462579]
[2025-01-30 19:24:14,591] [462579] [MainThread] [INFO] (uvicorn.error:48) - Waiting for application startup.
App Init...
[2025-01-30 19:24:14,592] [462579] [MainThread] [INFO] (monailabel.interfaces.utils.app:37) - Initializing App from: /home/ngogober/MONAILabel/apps/vista2d; studies: /home/ngogober/MONAILabel/datasets; conf: {'models': 'vista2d', 'preload': 'true', 'skip_trainers': 'true'}
[2025-01-30 19:24:14,648] [462579] [MainThread] [INFO] (monailabel.utils.others.class_utils:57) - Subclass for MONAILabelApp Found: <class 'main.VISTA2DApp'>
[2025-01-30 19:24:15,237] [462579] [MainThread] [INFO] (monailabel.utils.others.generic:304) - +++ Adding Bundle from Zoo: vista2d => /home/ngogober/MONAILabel/apps/vista2d/model/vista2d
2025-01-30 19:24:15,238 - INFO - --- input summary of monai.bundle.scripts.download ---
2025-01-30 19:24:15,238 - INFO - > name: 'vista2d'
2025-01-30 19:24:15,238 - INFO - > bundle_dir: '/home/ngogober/MONAILabel/apps/vista2d/model'
2025-01-30 19:24:15,238 - INFO - > source: 'monaihosting'
2025-01-30 19:24:15,238 - INFO - > repo: 'Project-MONAI/model-zoo/hosting_storage_v1'
2025-01-30 19:24:15,238 - INFO - > remove_prefix: 'monai_'
2025-01-30 19:24:15,238 - INFO - > progress: True
2025-01-30 19:24:15,238 - INFO - ---


vista2d_v0.3.0.zip: 652MB [00:20, 33.0MB/s]
2025-01-30 19:24:36,258 - INFO - Downloaded: /home/ngogober/MONAILabel/apps/vista2d/model/vista2d_v0.3.0.zip
2025-01-30 19:24:36,258 - INFO - Expected md5 is None, skip md5 check for file /home/ngogober/MONAILabel/apps/vista2d/model/vista2d_v0.3.0.zip.
2025-01-30 19:24:36,258 - INFO - Writing into directory: /home/ngogober/MONAILabel/apps/vista2d/model.
[2025-01-30 19:24:39,692] [462579] [MainThread] [INFO] (monailabel.utils.others.generic:364) - +++ Using Bundle Models: ['vista2d']
[2025-01-30 19:24:39,692] [462579] [MainThread] [INFO] (monailabel.interfaces.app:135) - Init Datastore for: /home/ngogober/MONAILabel/datasets
[2025-01-30 19:24:39,694] [462579] [MainThread] [INFO] (monailabel.datastore.local:130) - Auto Reload: True; Extensions: ['*.nii.gz', '*.nii', '*.nrrd', '*.jpg', '*.png', '*.tif', '*.svs', '*.xml']
[2025-01-30 19:24:39,695] [462579] [MainThread] [INFO] (monailabel.datastore.local:577) - Invalidate count: 0
[2025-01-30 19:24:39,695] [462579] [MainThread] [INFO] (monailabel.datastore.local:151) - Start observing external modifications on datastore (AUTO RELOAD)
[2025-01-30 19:24:39,721] [462579] [MainThread] [ERROR] (uvicorn.error:121) - Traceback (most recent call last):
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/monai/utils/module.py", line 243, in instantiate
    return component(**kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/monai/networks/nets/cell_sam_wrapper.py", line 59, in __init__
    raise ValueError(
ValueError: SAM is not installed, please run: pip install git+https://github.com/facebookresearch/segment-anything.git

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/starlette/routing.py", line 693, in lifespan
    async with self.lifespan_context(app) as maybe_state:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 133, in merged_lifespan
    async with original_context(app) as maybe_original_state:
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/monailabel/app.py", line 49, in lifespan
    instance = app_instance()
               ^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/monailabel/interfaces/utils/app.py", line 50, in app_instance
    app = c(app_dir=app_dir, studies=studies, conf=conf)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/apps/vista2d/main.py", line 48, in __init__
    super().__init__(
  File "/home/ngogober/MONAILabel/monailabel/interfaces/app.py", line 101, in __init__
    self._infers = self.init_infers()
                   ^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/apps/vista2d/main.py", line 64, in init_infers
    i = VISTA2DInfer(b, self.conf, model_state_dict="state_dict")
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/monailabel/tasks/infer/bundle.py", line 121, in __init__
    network = self.bundle_config.get_parsed_content(self.const.key_network_def(), instantiate=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/monai/bundle/config_parser.py", line 290, in get_parsed_content
    return self.ref_resolver.get_resolved_content(id=id, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/monai/bundle/reference_resolver.py", line 193, in get_resolved_content
    return self._resolve_one_item(id=id, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/monai/bundle/reference_resolver.py", line 171, in _resolve_one_item
    self.resolved_content[id] = item.instantiate() if kwargs.get("instantiate", True) else item
                                ^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/monai/bundle/config_item.py", line 292, in instantiate
    return instantiate(modname, mode, **args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ngogober/MONAILabel/.pixi/envs/default/lib/python3.12/site-packages/monai/utils/module.py", line 253, in instantiate
    raise RuntimeError(
RuntimeError: Failed to instantiate component 'monai.networks.nets.cell_sam_wrapper.CellSamWrapper' with keywords: checkpoint
 set '_mode_=debug' to enter the debugging mode.

[2025-01-30 19:24:39,722] [462579] [MainThread] [ERROR] (uvicorn.error:59) - Application startup failed. Exiting.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the installation instructions in sample-apps/vista2d and the generated apps/vista2d/requirements.txt. Review the listed commands and dependencies against the reported start_server output, then update the instructions so the application can start without the missing SAM dependency error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.