【问题标题】:AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__' on using "from keras.utils import HDF5Matrix"AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__' on using "from keras.utils import HDF5Matrix"
【发布时间】:2019-06-25 21:35:00
【问题描述】:

我刚刚用所有必要的模块将 python 重新安装到我的系统中。但是当我使用 import 语句from keras.utils import HDF5Matrix 运行程序时,它给出了属性错误。报错的地方是:File "h5py\h5r.pxd", line 21, in init h5py._conv File "h5py\h5r.pyx", line 145, in init h5py.h5r。但是当我直接在 IDLE 中运行相同的语句时,它没有给出任何错误。那么,错误的原因是什么。我没有发布我的代码,因为其中大部分是无关紧要的,因为解释器没有通过 import 语句。此外,在我重新安装 Python 之前,代码运行良好。那么,可能是什么问题。

【问题讨论】:

    标签: python tensorflow keras hdf5


    【解决方案1】:

    我得到了解决方案。这是因为我在同一个程序中同时导入了 HDF5Matrix 和表格。由于某种原因,两者都无法在同一个程序中导入。我认为这是因为两者都在后端使用 h5py,所以导入两者会导致一些冲突。

    【讨论】:

      猜你喜欢
      • 2021-07-12
      • 2022-12-27
      • 2019-08-31
      • 2017-03-08
      • 2020-11-23
      • 2022-12-01
      • 2019-06-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多