引入numpy的时候错误:
要是出现的错误是:
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa
试一下
sudo pip install numpy --upgrade
sudo easy_install numpy
pip uninstall numpy
如果错误是
AttributeError: 'numpy.ufunc' object has no attribute '__module__'
大多数应该是版本上的问题,重装是可以的,这个numpy1.15的版本也是可以用(亲测),如果在不行可以试试其他的方法。
两步解决:
//先卸载numpy,多卸载几次
pip uninstall numpy
//安装限定numpy版本
sudo pip install numpy==1.15.4
下载手写数字 MNIST 数据集时错误:
如果错误是
ConnectionResetError Traceback (most recent call last)
暂时并没有什么好办法,据说MNIST在2018年就停用了!
可以试试下面这个:
from sklearn import datasets
from keras.datasets import mnist
(X_train, y_train), (X_test, y_test) = mnist.load_data()
ImportError: dlopen(/anaconda3/envs/py3/lib/python3.6/site-packages/cv2.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libjasper.1.dylib
Referenced from: /anaconda3/envs/py3/lib/libopencv_imgcodecs.3.1.0.dylib
Reason: image not found
安装OpenMP:
brew install open-mpi