Unable to run monai-deploy run
mostafasynthesis opened this issue · 2 comments
Describe the bug
I have tested my scripts successfully via monai-deploy exec, and created a package via monai-deploy package. However, I am getting the following error when running it via monai-deploy run
Reading MONAI App Package manifest...
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Traceback (most recent call last):
File "/root/.local/lib/python3.8/site-packages/monai/deploy/core/io_context.py", line 112, in set
check_type("value", value, data_type)
TypeError: check_type() takes 2 positional arguments but 3 were given
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/monai/app/app.py", line 26, in
App(do_run=True)
File "/root/.local/lib/python3.8/site-packages/monai/deploy/core/application.py", line 129, in init
self.run(log_level=args.log_level)
File "/root/.local/lib/python3.8/site-packages/monai/deploy/core/application.py", line 429, in run
executor_obj.run()
File "/root/.local/lib/python3.8/site-packages/monai/deploy/core/executors/single_process_executor.py", line 93, in run
op_exec_context.input_context.set(DataPath(input_path, read_only=True), input_label)
File "/root/.local/lib/python3.8/site-packages/monai/deploy/core/io_context.py", line 114, in set
raise IOMappingError(
monai.deploy.exceptions.IOMappingError: The data type of 'image' in the input of '<preprocessor_operator.PreprocessorOperator object at 0x40c84f1e80>' is <class 'monai.deploy.core.domain.datapath.DataPath'>, but the value to set is the data type of <class 'monai.deploy.core.domain.datapath.DataPath'>.
ERROR: MONAI Application "arm_bone_segmentation:latest" failed.
Environment
It is to be noted that I am using the base image from "docker pull nvcr.io/nvidia/pytorch:21.07-py3" to create the package.
Printing MONAI config...
MONAI version: 1.1.0
Numpy version: 1.24.2
Pytorch version: 1.13.1
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: a2ec3752f54bfc3b40e7952234fbeb5452ed63e3
MONAI file: /Users/mostafapashazadeh/.pyenv/versions/3.10.8/lib/python3.10/site-packages/monai/init.py
Printing system config...
System: Darwin
Mac version: 12.2
Platform: macOS-12.2-arm64-arm-64bit
Processor: arm
Machine: arm64
Python version: 3.10.8
Process name: python3.10
Thanks @mostafasynthesis for raising the issue.
This has just become a known issue, caused by the newer versions of the typeguard pipi package. Please see the already closed earlier issue and the PR to fix the code (pending release of a new version of App SDK). In the meantime, we are still to find a better way to publish the workaound.
Addressed in 0.5.1, and pinning typeguard~=2.12 must be removed to work with the new version