关于python:导入Keras引发了numpy异常

Importing Keras raises numpy exceptions

嗨,我正在尝试用如下开头的代码设置keras:

1
2
3
4
from keras.layers.core import Dense, Activation, Dropout
from keras.layers.recurrent import LSTM
from keras.models import Sequential
import lstm, time #helper libraries

它给我带来了以下错误信息:

RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb

ImportError Traceback (most recent call last)
ImportError: numpy.core.multiarray failed to import

ImportError Traceback (most recent call last)
ImportError: numpy.core.umath failed to import

ImportError Traceback (most recent call last)
ImportError: numpy.core.umath failed to import

事先谢谢!


尝试重新安装:

1
pip install -U numpy