Skip to content

Mac apple chip: mac docker Could not initialize NNPACK! Reason: Unsupported hardware. #406

Open
@cmjxll

Description

@cmjxll

出现这个问题, apple chip和当前的镜像不兼容. 需要在Mac上重新build:

  1. Use Rosetta for x86_64/amd64 emulation on Apple Silicon (https://www.docker.com/blog/docker-desktop-4-25/)

  2. 在Latex-OCR下建立dockerfile
    FROM python:3.8-slim
    RUN pip install torch>=1.7.1
    WORKDIR /latexocr
    COPY pix2tex /latexocr/pix2tex/
    COPY setup.py /latexocr/
    COPY README.md /latexocr/
    RUN pip install -e .[api]
    RUN python -m pix2tex.model.checkpoints.get_latest_checkpoint
    ENTRYPOINT ["uvicorn", "pix2tex.api.app:app", "--host", "0.0.0.0", "--port", "8502"]"

  3. 修改cli.py代码 ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() #392

  4. 然后build.
    docker buildx build --platform linux/arm64 -t lukasblecher/pix2tex:api-arm64 --load .

mac 系统安装包会出现包冲突问题, 感觉用docker(linux系统环境)会好点,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions