前一天tensorflow还在愉快地跑着 过一天就出现如下错误
Traceback (most recent call last):
File stdin , line 1, in module
File e:\\Anaconda3\\lib\\site-packages\\tensorflow\\__init__.py , line 41, in module
from tensorflow.python.tools import module_util as _module_util
File e:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\__init__.py , line 47, in module
from tensorflow.python import keras
File e:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\keras\\__init__.py , line 27, in module
from tensorflow.python.keras import models
File e:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\keras\\models.py , line 26, in module
from tensorflow.python.keras.engine import functional
File e:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\keras\\engine\\functional.py , line 38, in module
from tensorflow.python.keras.engine import training as training_lib
File e:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\keras\\engine\\training.py , line 53, in module
from tensorflow.python.keras.saving import hdf5_format
File e:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\keras\\saving\\hdf5_format.py , line 41, in module
import h5py
File e:\\Anaconda3\\lib\\site-packages\\h5py\\__init__.py , line 55, in module
from . import h5a, h5d, h5ds, h5f, h5fd, h5g, h5r, h5s, h5t, h5p, h5z, h5pl
File h5py\\h5a.pyx , line 295, in init h5py.h5a
AttributeError: type object h5py.h5a.AttrID has no attribute __reduce_cython__
想了想 试着import h5py, 结果出现一样的错误 原来是因为tensorflow2.3版本只适合h5py 2.10.0版本 于是
pip install h5py 2.10.0
问题解决





本文链接: http://mattrid.immuno-online.com/view-772271.html