Mac M1安装paddlepaddle报错,报错信息,zsh: illegal hardware instruction python

  • Post author:
  • Post category:python


Mac M1 安装paddlepaddle-cpu版本后,

import paddle

报错,报错信息是,

>>> import paddle
zsh: illegal hardware instruction  python

原因分析:是因为paddlepaddle版本问题

conda安装低版本,

pip命令如下:

 pip install paddlepaddle==2.2.2 -i https://pypi.tuna.tsinghua.edu.cn/simple --default-timeout=1000

conda安装命令如下:

conda install paddlepaddle==2.2.2 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/

安装成功后,依然报错,

ModuleNotFoundError: No module named 'chardet'

然后,安装chardet模块就好。

pip install chardet

然后check下模型是否安装成功,

>>> import paddle
python3.8/site-packages/paddle/vision/transforms/functional_pil.py:36: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
  'nearest': Image.NEAREST,
python3.8/site-packages/paddle/vision/transforms/functional_pil.py:37: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
  'bilinear': Image.BILINEAR,
python3.8/site-packages/paddle/vision/transforms/functional_pil.py:38: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
  'bicubic': Image.BICUBIC,
python3.8/site-packages/paddle/vision/transforms/functional_pil.py:39: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead.
  'box': Image.BOX,
python3.8/site-packages/paddle/vision/transforms/functional_pil.py:40: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
  'lanczos': Image.LANCZOS,
python3.8/site-packages/paddle/vision/transforms/functional_pil.py:41: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead.
  'hamming': Image.HAMMING
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
PaddlePaddle works well on 1 CPU.
W0306 17:30:24.282088 82227904 fuse_all_reduce_op_pass.cc:76] Find all_reduce operators: 2. To make the speed faster, some all_reduce ops are fused during training, after fusion, the number of all_reduce ops is 2.
PaddlePaddle works well on 2 CPUs.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
>>> paddle.__version__
'2.2.2'

over!



版权声明:本文为woai8339原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。