Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cmjxll opened this issue Dec 2, 2024 · 0 comments

Comments

@cmjxll
Copy link

cmjxll commented Dec 2, 2024

出现这个问题, 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系统环境)会好点,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant