From 7de9f9b566b6f9baf73fc7a790d964248dd39c3d Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:33:17 +0800 Subject: [PATCH 1/4] fix #8160 Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- tests/test_bundle_download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_bundle_download.py b/tests/test_bundle_download.py index 02a9f40846..399c61b117 100644 --- a/tests/test_bundle_download.py +++ b/tests/test_bundle_download.py @@ -250,7 +250,7 @@ def test_download_monaihosting(self, mock_get_versions): mock_logger.warning.assert_called_once() @skip_if_quick - @patch("monai.bundle.scripts.get_versions", return_value={"version": "1.2"}) + @patch("monai.bundle.scripts.get_versions", return_value={"version": "1.3"}) def test_download_ngc(self, mock_get_versions): """Test checking MONAI version from a metadata file.""" with patch("monai.bundle.scripts.logger") as mock_logger: From 37f06c418ea9983b80c4af2e8f72f2b357c5c092 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Fri, 18 Oct 2024 21:41:42 +0800 Subject: [PATCH 2/4] set type ignore as a workaround Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- monai/networks/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/networks/utils.py b/monai/networks/utils.py index d0150b4e5b..ffd605a933 100644 --- a/monai/networks/utils.py +++ b/monai/networks/utils.py @@ -694,7 +694,7 @@ def convert_to_onnx( else: f = filename - torch.onnx.export( + torch.onnx.export( # type: ignore[arg-type] mode_to_export, onnx_inputs, f=f, From 235e37c95f90458d2b8f9436e30e7fc6e839c2a3 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:28:31 +0800 Subject: [PATCH 3/4] minor fix Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- monai/networks/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monai/networks/utils.py b/monai/networks/utils.py index ffd605a933..68f34f68a2 100644 --- a/monai/networks/utils.py +++ b/monai/networks/utils.py @@ -694,7 +694,7 @@ def convert_to_onnx( else: f = filename - torch.onnx.export( # type: ignore[arg-type] + torch.onnx.export( mode_to_export, onnx_inputs, f=f, @@ -704,7 +704,7 @@ def convert_to_onnx( opset_version=opset_version, do_constant_folding=do_constant_folding, **torch_versioned_kwargs, - ) + ) # type: ignore[arg-type] if filename is None: onnx_model = onnx.load_model_from_string(f.getvalue()) else: From df4501af671d0a4d5dd9d07969006940a7109892 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:02:14 +0800 Subject: [PATCH 4/4] minor fix Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- monai/networks/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monai/networks/utils.py b/monai/networks/utils.py index 68f34f68a2..295a055390 100644 --- a/monai/networks/utils.py +++ b/monai/networks/utils.py @@ -697,14 +697,14 @@ def convert_to_onnx( torch.onnx.export( mode_to_export, onnx_inputs, - f=f, + f=f, # type: ignore[arg-type] input_names=input_names, output_names=output_names, dynamic_axes=dynamic_axes, opset_version=opset_version, do_constant_folding=do_constant_folding, **torch_versioned_kwargs, - ) # type: ignore[arg-type] + ) if filename is None: onnx_model = onnx.load_model_from_string(f.getvalue()) else: