飞桨CPU版的PaddlePaddle安装总结
Posted ur home
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了飞桨CPU版的PaddlePaddle安装总结相关的知识,希望对你有一定的参考价值。
1. 可以使用以下命令查看本机的操作系统和位数信息:
uname -m && cat /etc/*release
2. python版本查看,使用以下命令确认是 3.6/3.7/3.8/3.9
python --version
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‘,解决参考博客
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 "<stdin>", line 1, in <module>
File "/usr/local/python3/lib/python3.7/site-packages/paddle/__init__.py", line 25, in <module>
from .fluid import monkey_patch_variable
File "/usr/local/python3/lib/python3.7/site-packages/paddle/fluid/__init__.py", line 36, in <module>
from . import framework
File "/usr/local/python3/lib/python3.7/site-packages/paddle/fluid/framework.py", line 37, in <module>
from . import core
File "/usr/local/python3/lib/python3.7/site-packages/paddle/fluid/core.py", line 294, in <module>
raise e
File "/usr/local/python3/lib/python3.7/site-packages/paddle/fluid/core.py", line 256, in <module>
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 解决参考博客
问题2 ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found 解决参考博客
百度AI 验证安装失败http://ai.baidu.com/forum/topic/show/983545http://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%84PaddlePaddlehttps://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
以上是关于飞桨CPU版的PaddlePaddle安装总结的主要内容,如果未能解决你的问题,请参考以下文章