首页 Paddle框架 帖子详情
Centos 7.2 环境下报错
收藏
快速回复
Paddle框架 问答深度学习 551 0
Centos 7.2 环境下报错
收藏
快速回复
Paddle框架 问答深度学习 551 0

环境:centos7.2 64bit

*The Python version is: Python3.8 from "/www/wwwroot/api/fastapi_venv/bin/python"
* The NumPy version is: "1.20.2"

NumPy已升级到最新

在centos venv环境下,通过unicorn启动,爆出如下错误,

折腾了好久,实在折腾不动了,求大神搭救

逻辑代码如下:

    humanseg = hub.Module(name='deeplabv3p_xception65_humanseg')
    imgs = ['./img/a.jpg']
    output_dir = './img/output/'
    humanseg.segmentation(data={'image': imgs}, output_dir=output_dir)

报错如下:

Traceback (most recent call last):
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/__init__.py", line 22, in 
    from . import multiarray
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/multiarray.py", line 12, in 
    from . import overrides
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/overrides.py", line 7, in 
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run.py", line 3, in 
    from cate import *
  File "/www/wwwroot/api/cate/__init__.py", line 15, in 
    from cate.shenhuo.zhengjianzhao import zhengjianzhao
  File "/www/wwwroot/api/cate/shenhuo/zhengjianzhao.py", line 4, in 
    import paddlehub as hub
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddlehub/__init__.py", line 18, in 
    import paddle
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/__init__.py", line 29, in 
    from .fluid import monkey_patch_variable
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/fluid/__init__.py", line 35, in 
    from . import framework
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/fluid/framework.py", line 28, in 
    import numpy as np
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/__init__.py", line 145, in 
    from . import core
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/__init__.py", line 48, in 
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/www/wwwroot/api/fastapi_venv/bin/python"
  * The NumPy version is: "1.20.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

(fastapi_venv) [root@localhost api]# python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
Looking in indexes: https://mirror.baidu.com/pypi/simple
Requirement already satisfied: paddlepaddle in ./fastapi_venv/lib/python3.8/site-packages (2.0.2)
Requirement already satisfied: decorator in ./fastapi_venv/lib/python3.8/site-packages (from paddlepaddle) (5.0.6)
Requirement already satisfied: six in ./fastapi_venv/lib/python3.8/site-packages (from paddlepaddle) (1.15.0)
Requirement already satisfied: Pillow in ./fastapi_venv/lib/python3.8/site-packages (from paddlepaddle) (8.2.0)
Requirement already satisfied: requests>=2.20.0 in ./fastapi_venv/lib/python3.8/site-packages (from paddlepaddle) (2.25.1)
Requirement already satisfied: astor in ./fastapi_venv/lib/python3.8/site-packages (from paddlepaddle) (0.8.1)
Requirement already satisfied: protobuf>=3.1.0 in ./fastapi_venv/lib/python3.8/site-packages (from paddlepaddle) (3.15.8)
Requirement already satisfied: gast>=0.3.3 in ./fastapi_venv/lib/python3.8/site-packages (from paddlepaddle) (0.4.0)
Requirement already satisfied: numpy>=1.13 in ./fastapi_venv/lib/python3.8/site-packages (from paddlepaddle) (1.20.2)
Requirement already satisfied: certifi>=2017.4.17 in ./fastapi_venv/lib/python3.8/site-packages (from requests>=2.20.0->paddlepaddle) (2020.12.5)
Requirement already satisfied: idna<3,>=2.5 in ./fastapi_venv/lib/python3.8/site-packages (from requests>=2.20.0->paddlepaddle) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./fastapi_venv/lib/python3.8/site-packages (from requests>=2.20.0->paddlepaddle) (1.26.4)
Requirement already satisfied: chardet<5,>=3.0.2 in ./fastapi_venv/lib/python3.8/site-packages (from requests>=2.20.0->paddlepaddle) (4.0.0)
(fastapi_venv) [root@localhost api]# python run.py 
Traceback (most recent call last):
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/__init__.py", line 22, in 
    from . import multiarray
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/multiarray.py", line 12, in 
    from . import overrides
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/overrides.py", line 7, in 
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run.py", line 3, in 
    from cate import *
  File "/www/wwwroot/api/cate/__init__.py", line 15, in 
    from cate.shenhuo.zhengjianzhao import zhengjianzhao
  File "/www/wwwroot/api/cate/shenhuo/zhengjianzhao.py", line 4, in 
    import paddlehub as hub
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddlehub/__init__.py", line 18, in 
    import paddle
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/__init__.py", line 29, in 
    from .fluid import monkey_patch_variable
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/fluid/__init__.py", line 35, in 
    from . import framework
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/fluid/framework.py", line 28, in 
    import numpy as np
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/__init__.py", line 145, in 
    from . import core
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/__init__.py", line 48, in 
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/www/wwwroot/api/fastapi_venv/bin/python"
  * The NumPy version is: "1.20.2"
(fastapi_venv) [root@localhost api]# python run.py 
Traceback (most recent call last):
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/__init__.py", line 22, in 
    from . import multiarray
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/multiarray.py", line 12, in 
    from . import overrides
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/overrides.py", line 7, in 
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run.py", line 3, in 
    from cate import *
  File "/www/wwwroot/api/cate/__init__.py", line 15, in 
    from cate.shenhuo.zhengjianzhao import zhengjianzhao
  File "/www/wwwroot/api/cate/shenhuo/zhengjianzhao.py", line 4, in 
    import paddlehub as hub
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddlehub/__init__.py", line 18, in 
    import paddle
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/__init__.py", line 29, in 
    from .fluid import monkey_patch_variable
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/fluid/__init__.py", line 35, in 
    from . import framework
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/fluid/framework.py", line 28, in 
(fastapi_venv) [root@localhost api]# python run.py 
Traceback (most recent call last):
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/__init__.py", line 22, in 
    from . import multiarray
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/multiarray.py", line 12, in 
    from . import overrides
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/overrides.py", line 7, in 
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run.py", line 3, in 
    from cate import *
  File "/www/wwwroot/api/cate/__init__.py", line 15, in 
    from cate.shenhuo.zhengjianzhao import zhengjianzhao
  File "/www/wwwroot/api/cate/shenhuo/zhengjianzhao.py", line 4, in 
    import paddlehub as hub
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddlehub/__init__.py", line 18, in 
    import paddle
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/__init__.py", line 29, in 
    from .fluid import monkey_patch_variable
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/fluid/__init__.py", line 35, in 
    from . import framework
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/paddle/fluid/framework.py", line 28, in 
    import numpy as np
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/__init__.py", line 145, in 
    from . import core
  File "/www/wwwroot/api/fastapi_venv/lib/python3.8/site-packages/numpy/core/__init__.py", line 48, in 
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/www/wwwroot/api/fastapi_venv/bin/python"
  * The NumPy version is: "1.20.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'
0
收藏
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户