keras导入出错:runtimeError:module compiled against API version 0xc but this version of numpy is 0xb

在这里插入图片描述

runtimeError:module compiled against API version 0xc but this version of numpy is 0xb

看图知道是numpy版本的问题,所以

pip install numpy==1.14.5 -i https://pypi.tuna.tsinghua.edu.cn/simple

成功。
主要是因为keras依赖的numpy包的问题

RuntimeError Traceback (most recent call last) RuntimeError: module compiled against API version 0xf but this version of numpy is 0xd --------------------------------------------------------------------------- ImportError Traceback (most recent call last) ImportError: numpy.core.multiarray failed to import The above exception was the direct cause of the following exception: SystemError Traceback (most recent call last) SystemError: <built-in method __contains__ of dict object at 0x00000270A8577F80> returned a result with an error set The above exception was the direct cause of the following exception: ImportError Traceback (most recent call last) <ipython-input-21-035b45420c6e> in <module> ----> 1 from model.build_mtcnn_model import create_Pnet, create_Rnet, create_Onet 2 import numpy as np 3 import cv2 4 5 ~\Desktop\第五课 实战案例:基于FaceNet的人脸智能识别 - 副本\(ppt、源代码、数据)数据&代码\数据&代码\基于FaceNet的人脸智能识别\model\build_mtcnn_model.py in <module> ----> 1 from tensorflow.keras.layers import Conv2D, Input, MaxPool2D, Flatten, Dense, Permute 2 from tensorflow.keras.layers import PReLU 3 from tensorflow.keras.models import Model 4 5 # -----------------------------# C:\StFiles\Anaconda\lib\site-packages\tensorflow\__init__.py in <module> 36 import typing as _typing 37 ---> 38 from tensorflow.python.tools import module_util as _module_util 39 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader 40 C:\StFiles\Anaconda\lib\site-packages\tensorflow\python\__init__.py in <module> 35 36 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow ---> 37 from tensorflow.python.eager import context 38 39 # pylint: enable=wildcard-import C:\StFiles\Anaconda\lib\site-packages\tensorflow\python\eager\context.py in <module> 32 from tensorflow.python
最新发布
03-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值