飞桨CPU版的PaddlePaddle安装总结

 1. 可以使用以下命令查看本机的操作系统和位数信息:

uname -m && cat /etc/*release

2. python版本查看,使用以下命令确认是 3.6/3.7/3.8/3.9

python --version

linux python3安装https://blog.csdn.net/wz_coming/article/details/122124026icon-default.png?t=LA92https://blog.csdn.net/wz_coming/article/details/122124026

3. 需要确认pip的版本是否满足要求,要求pip版本为20.2.2或更高版本

python -m ensurepip

python -m pip --version

4. 需要确认Python和pip是64bit,并且处理器架构是x86_64(或称作x64、Intel 64、AMD64)架构,目前PaddlePaddle不支持arm64架构。下面的第一行输出的是”64bit”,第二行输出的是”x86_64”、”x64”或”AMD64”即可:

python -c "import platform;print(platform.architecture()[0]);print(platform.machine())"

5.  
CPU版的PaddlePaddle

python -m pip install paddlepaddle==2.2.1 -i https://mirror.baidu.com/pypi/simple

安装中出现ModuleNotFoundError: No module named ‘_ctypes‘,解决参考博客

关于在centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named ‘_ctypes‘的解决办法https://blog.csdn.net/qq_36416904/article/details/79316972icon-default.png?t=LA92https://blog.csdn.net/qq_36416904/article/details/79316972

6. 安装成功,输入import paddle,显示以下错误

Error: Can not import avx core while this file exists: /usr/local/python3/lib/python3.7/site-packages/paddle/fluid/core_avx.so
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/python3/lib/python3.7/site-packages/paddle/__init__.py", line 25, in 
    from .fluid import monkey_patch_variable
  File "/usr/local/python3/lib/python3.7/site-packages/paddle/fluid/__init__.py", line 36, in 
    from . import framework
  File "/usr/local/python3/lib/python3.7/site-packages/paddle/fluid/framework.py", line 37, in 
    from . import core
  File "/usr/local/python3/lib/python3.7/site-packages/paddle/fluid/core.py", line 294, in 
    raise e
  File "/usr/local/python3/lib/python3.7/site-packages/paddle/fluid/core.py", line 256, in 
    from .core_avx import *
ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/python3/lib/python3.7/site-packages/paddle/fluid/core_avx.so)

问题1 Can not import avx core while this file exists 解决参考博客

飞桨Paddle 2.0安装成功,运行报错:from . core_avx import * 找不到指定模块https://blog.csdn.net/u010674979/article/details/117224889icon-default.png?t=LA92https://blog.csdn.net/u010674979/article/details/117224889

问题2 ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found  解决参考博客


通用方法 解决/usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found的问题https://blog.csdn.net/u012811841/article/details/77854581icon-default.png?t=LA92https://blog.csdn.net/u012811841/article/details/77854581


libstdc++.so.6.0.24资源包下载https://blog.csdn.net/weixin_43227196/article/details/110946066icon-default.png?t=LA92https://blog.csdn.net/weixin_43227196/article/details/110946066

百度AI 验证安装失败http://ai.baidu.com/forum/topic/show/983545icon-default.png?t=LA92http://ai.baidu.com/forum/topic/show/983545

7. 成功

import paddle

>>> import paddle
/usr/local/python3/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py:943: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  collections.MutableMapping.register(ParseResults)
/usr/local/python3/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py:3226: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  elif isinstance( exprs, collections.Iterable ):
/usr/local/python3/lib/python3.7/site-packages/setuptools/depends.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp

paddle.utils.run_check()

>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
PaddlePaddle works well on 1 CPU.
W1224 11:50:41.558108 18713 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.

官方文档https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/linux-pip.html#old-version-anchor-6-2.1%20CPU%E7%89%88%E7%9A%84PaddlePaddleicon-default.png?t=LA92https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/linux-pip.html#old-version-anchor-6-2.1%20CPU%E7%89%88%E7%9A%84PaddlePaddle

你可能感兴趣的:(python,paddle,人工智能,深度学习,PaddlePaddle)