How to install paddlepaddle with no-avx core

2.3k Views Asked by At

I am trying to use paddleocr in a docker container and keep getting the error below:

Dockerfile

FROM paddlecloud/paddleocr:2.5-gpu-cuda10.2-cudnn7-85d7d5

In docker container after building it:

In [1]: from paddleocr import PaddleOCR
/bin/grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
/bin/grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
Error: Your machine doesn't support AVX, but the installed PaddlePaddle is avx core, you should reinstall paddlepaddle with no-avx core.
---------------------------------------------------------------------------
ImportError  

..
..
/usr/local/lib/python3.7/dist-packages/paddle/fluid/core.py in <module>
    311 if load_noavx:
    312     try:
--> 313         from . import core_noavx
    314         core_noavx.LoDTensor = core_noavx.Tensor
    315 

ImportError: cannot import name 'core_noavx' from 'paddle.fluid' (/usr/local/lib/python3.7/dist-packages/paddle/fluid/__init__.py)

The host is Apple Silicon - M1 Mac

1

There are 1 best solutions below

0
On

If your machine does not support avx, you need to install the Paddle package of noavx, you can use the following command to install,noavx version paddle wheel only support python3.8:

First use the following command to download the wheel package to the local, and then use python -m pip install [name].whl to install locally ([name] is the name of the wheel package):

cpu and mkl version installed on noavx machine:

python -m pip download paddlepaddle==2.3.2 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/noavx/stable.html --no-index --no-deps

cpu and openblas version installed on noavx machine:

python -m pip download paddlepaddle==2.3.2 -f https://www.paddlepaddle.org.cn/whl/linux/openblas/noavx/stable.html --no-index --no-deps

GPU cuda10.1 version install on noavx machine:

python -m pip download paddlepaddle-gpu==2.3.2.post101 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/noavx/stable.html --no-index --no-deps

GPU cuda10.2 version install on noavx machine:

python -m pip download paddlepaddle-gpu==2.3.2 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/noavx/stable.html --no-index --no-deps

To determine whether your machine supports avx, you can use the following command. If the output contains avx, it means that the machine supports avx:

cat /proc/cpuinfo | grep -i avx

If you want to install the Paddle package with avx and openblas, you can use the following command to download the wheel package to the local, and then use python -m pip install [name].whl to install locally ([name] is the name of the wheel package):

python -m pip download paddlepaddle==2.3.2 -f https://www.paddlepaddle.org.cn/whl/linux/openblas/avx/stable.html --no-index --no-deps

I found this from the official website