macOS system with M2 not compatible with MPS:NotImplementedError: The operator 'aten::upsample_bicubic2d.out' is not currently implemented for the MPS device.
Description of the bug | 错误描述
NotImplementedError: The operator 'aten::upsample_bicubic2d.out' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1 to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.
How to reproduce the bug | 如何复现
-
Create a virtual environment using venv
-
Compile detectron2
-
Install magic-pdf[full]==0.6.2b1
-
Create the magic-pdf.json file in your home directory and modify models and devises to reflect the path of model files and MPS
-
Execute magic-pdf pdf-command --pdf "//xxx/yyy.pdf" --inside_model true Error occurred: 2024-08-07 09:14:12.262 | INFO | magic_pdf.model.pdf_extract_kit:init:124 - DocAnalysis init done! 2024-08-07 09:14:12.263 | INFO | magic_pdf.model.doc_analyze_by_custom_model:doc_analyze:74 - model init cost: 41.09199285507202 Traceback (most recent call last): ... /code/myenv/lib/python3.10/site-packages/torch/nn/functional.py", line 4073, in interpolate return torch._C._nn.upsample_bicubic2d(input, output_size, align_corners, scale_factors) NotImplementedError: The operator 'aten::upsample_bicubic2d.out' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable
PYTORCH_ENABLE_MPS_FALLBACK=1to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.
Operating system | 操作系统
MacOS
Python version | Python 版本
3.10
Software version | 软件版本 (magic-pdf --version)
0.6.x
Device mode | 设备模式
mps
https://github.com/opendatalab/MinerU/issues/238#issuecomment-2256390257