Closed kavmar closed 5 months ago
@kavmar, thanks for raising the issues on the outdated documentation for this example.
A pull request is being prepared by the contributor, in the meantime, please use the Jupyter notebooks to see the correct commands for running the example applications as script, packaging the application into MONAI Application Package (container image), and running the MAP container.
Below are the root causes of the errors:
The exec
sub command of monai-deploy
had been deprecated since MONAI Deploy App SDK v0.6. Please directly use Python interpreter to run the application, e.g.
python /home/mqin/src/monai-deploy-app-sdk/examples/apps/breast_density_classifer_app \
-i /home/mqin/src/monai-deploy-app-sdk/inputs/BreastDensityClassification/sampleDICOMs/1/BI_BREAST_SCREENING_BILATERAL_WITH_TOMOSYNTHESIS-2019-07-08/1/L_CC_C-View \
-o /home/mqin/src/monai-deploy-app-sdk/output_breast_density \
-m /home/mqin/src/monai-deploy-app-sdk/models/breast_density_cr/traced_ts_model.pt
Alternatively, the input, output, and model path can be set in the well-known env variables instead of passed on the command line, e.g.
export HOLOSCAN_INPUT_PATH="/home/mqin/src/monai-deploy-app-sdk/inputs/BreastDensityClassification/sampleDICOMs/1/BI_BREAST_SCREENING_BILATERAL_WITH_TOMOSYNTHESIS-2019-07-08/1/L_CC_C-View"
export HOLOSCAN_MODEL_PATH="/home/mqin/src/monai-deploy-app-sdk/models/breast_density_cr/traced_ts_model.pt"
export HOLOSCAN_OUTPUT_PATH="/home/mqin/src/monai-deploy-app-sdk/output_breast_density"
The run
sub command of monai-deploy
launches the MAP container with the image name passed on the command line
For the packaging error, the command line option -b
had also been deprecated since v0.6, and the full version, --base-image
, needs to be used, as you have found out.
The named based image is also out of date, and the new monai-deploy packge
picks a well-known default image according to the --platform
option.
Besides the app config file, app.yaml, and the package requirement file are also needed for the specifying the dependencies of the application.
@vikashg
@kavmar I've gone ahead and created a pull request to fix the issues.
Thanks a lot. Going to test.
@MMelQin thanks a lot, I confirm the instructions in breast classifier application example work.
A tiny glitch/request: would be great to support monai-deploy-app-sdk on Ubuntu 24 as well. holoscan is not compatible. I am lucky to have also a box with Ubuntu 22
@MMelQin thanks a lot, I confirm the instructions in breast classifier application example work.
A tiny glitch/request: would be great to support monai-deploy-app-sdk on Ubuntu 24 as well. holoscan is not compatible. I am lucky to have also a box with Ubuntu 22
@kavmar I'd love to support Ubuntu 24 as well, and technically it should work.
The Holoscan SDK dependency has only been formally tested on Ubuntu 22.04 LTS. Holoscan V&V encompasses hardware (including ARM/X86 CPU, integrated and discreet GPU), OS, and the software, for the devkit to be capable of being cleared as a medical device.
However, here is the official statement on Holoscan SDK python package: "The Holoscan SDK python wheels are only formally tested on Ubuntu 22.04. They are, however, expected to work on any Linux distribution with glibc 2.35 or above (see output of ldd --version) and CUDA Runtime 12.2 or above."
So, technically on X86 with discreet GPU and Ubuntu 24, Holoscan SDK would work fine, so does MONAI Deploy App SDK.
Hi,
I am trying to start off with monai-deploy by following examples/apps breast_density_classifier
I am on ubuntu 22.04 and I am only able to run successfully using Python CLI.
When I try to run it using monai-deploy cli monai-deploy exec app.py -i ./sampleDICOMs/3/BI_BREAST_SCREENING_BILATERAL_WITH_TOMOSYNTHESIS-2019-08-06/3 -m ./model/traced_ts_model.pt
I get error: monai-deploy: error: argument command: invalid choice: 'exec' (choose from 'package', 'run', 'version', 'nics')
So obviously 'exec' needs to be replaced by 'run'
However, when I do that, I get further error: monai-deploy: error: unrecognized arguments: -m ./model/traced_ts_model.pt
Running monai-deploy run --help does not list any -m cli argument. Removing it and trying to run:
monai-deploy run app.py -i ./sampleDICOMs/3/BI_BREAST_SCREENING_BILATERAL_WITH_TOMOSYNTHESIS-2019-08-06/3
results in next error: [2024-05-22 11:22:11,121] [INFO] (runner) - Checking dependencies... [2024-05-22 11:22:11,121] [INFO] (runner) - --> Verifying if "docker" is installed...
[2024-05-22 11:22:11,130] [INFO] (runner) - --> Verifying if "docker-buildx" is installed...
[2024-05-22 11:22:11,152] [INFO] (runner) - --> Verifying if "app.py" is available...
[2024-05-22 11:22:11,199] [INFO] (common) - Attempting to pull image app.py.. Using default tag: latest Error response from daemon: pull access denied for app.py, repository does not exist or may require 'docker login': denied: requested access to the resource is denied [2024-05-22 11:22:13,124] [ERROR] (common) - The docker command executed was
/usr/bin/docker image pull app.py
. It returned with code 1 The content of stdout can be found above the stacktrace (it wasn't captured). The content of stderr can be found above the stacktrace (it wasn't captured). [2024-05-22 11:22:13,124] [ERROR] (runner) - Unable to fetch required image. [2024-05-22 11:22:13,124] [ERROR] (runner) - Execution AbortedGoing one level up, as suggested nd running: monai-deploy run breast_density_classifer_app -i ./sampleDICOMs/3/BI_BREAST_SCREENING_BILATERAL_WITH_TOMOSYNTHESIS-2019-08-06/3
results in the same error as with previous command.
And finally packaging does'n seem to work either for me: monai-deploy package -b nvcr.io/nvidia/pytorch:21.12-py3 breast_density_classification_app --tag breast_density:0.1.0
results in error: monai-deploy package: error: argument application: No such file/folder: '/PATH/TO/PROJECT/monai-deploy/nvcr.io/nvidia/pytorch:21.12-py3'
I found out that if I don't use abbreviated cli argument, -b, for base image but a full one, --base-image this works. So this might even classify as a bug. However, this still does not fly since the next problem is: monai-deploy package: error: the following arguments are required: --config/-c, --platform
I had to pull in and adapt the app.yaml from other examples and provide --platform. So the correct cli which moved me further was: monai-deploy package --base-image nvcr.io/nvidia/pytorch:21.12-py3 breast_density_classifer_app --tag breast_density:0.1.0 --config breast_density_classifer_app/app.yaml --platform x64-workstation
However, as of today the base-image for pytorch container with version 21.12 (december 2021) is very outdated and it was not able to resolve conflicting packages and creating of docker image failed. So I tried using more recent base image 24.04.-py3, which succeeded, but then running the whole thing failed:
monai-deploy run breast_density_classifer_app-x64-workstation-dgpu-linux-amd64:0.2.0 -i breast_density_classifer_app/sampleDICOMs/3/BI_BREAST_SCREENING_BILATERAL_WITH_TOMOSYNTHESIS-2019-08-06/3 [2024-05-22 12:01:26,929] [INFO] (runner) - Checking dependencies... [2024-05-22 12:01:26,929] [INFO] (runner) - --> Verifying if "docker" is installed...
[2024-05-22 12:01:26,930] [INFO] (runner) - --> Verifying if "docker-buildx" is installed...
[2024-05-22 12:01:26,930] [INFO] (runner) - --> Verifying if "breast_density_classifer_app-x64-workstation-dgpu-linux-amd64:0.2.0" is available...
[2024-05-22 12:01:27,066] [INFO] (runner) - Reading HAP/MAP manifest... Successfully copied 2.56kB to /tmp/tmp4et7tool/app.json Successfully copied 2.05kB to /tmp/tmp4et7tool/pkg.json [2024-05-22 12:01:28,360] [INFO] (runner) - --> Verifying if "nvidia-ctk" is installed...
[2024-05-22 12:01:28,361] [INFO] (runner) - --> Verifying "nvidia-ctk" version...
[2024-05-22 12:01:29,008] [INFO] (common) - Launching container (01deeea6c946) using image 'breast_density_classifer_app-x64-workstation-dgpu-linux-amd64:0.2.0'... container name: heuristic_perlman host name: buddha network: host user: 1000:1000 ulimits: memlock=-1:-1, stack=67108864:67108864 cap_add: CAP_SYS_PTRACE ipc mode: host shared memory size: 67108864 devices:
group_add: 44 2024-05-22 10:01:34 [INFO] Launching application python3 /opt/holoscan/app ...
Error processing line 1 of /home/holoscan/.local/lib/python3.10/site-packages/holoscan-2.0.0.pth:
Traceback (most recent call last):
ModuleNotFoundError: No module named 'filelock'
Remainder of file ignored
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
File "/opt/holoscan/app/main.py", line 3, in
File "/opt/holoscan/app/app.py", line 4, in
File "/opt/holoscan/app/breast_density_classifier_operator.py", line 8, in
ModuleNotFoundError: No module named 'monai.data'
[2024-05-22 12:01:41,772] [INFO] (common) - Container 'heuristic_perlman'(01deeea6c946) exited.
**Would be great if we could have a complete and working example.
Thanks**