Open KumoLiu opened 4 days ago
related to the new release from mypy: https://pypi.org/project/mypy/#history
mypy 1.11.2 (compiled: yes)
monai/networks/utils.py:700:15: error: Argument "f" to "export" has incompatible type "BytesIO"; expected "Union[str, PathLike[Any], None]" [arg-type]
mypy 1.11.2 (compiled: yes) monai/networks/utils.py:700:15: error: Argument "f" to "export" has incompatible type "BytesIO"; expected "Union[str, PathLike[Any], None]" [arg-type]
Hi @borisfom and @binliunls, It seems that since version 2.5.0, the f
parameter in torch.onnx.export
no longer accepts BytesIO. Do you have any suggestions on how we can address this mypy issue?
https://github.com/pytorch/pytorch/blob/v2.5.0/torch/onnx/utils.py#L178
https://github.com/Project-MONAI/MONAI/blob/dev/monai/networks/utils.py#L693
Ignore it as a workaround in this pr: https://github.com/Project-MONAI/MONAI/pull/8161 to ensure the ci pass. We can fix it later.