简体   繁体   English

AttributeError:类型对象“ h5py.h5r.Reference”在使用“从keras.utils导入HDF5Matrix”时没有属性“ __reduce_cython__”

[英]AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__' on using “from keras.utils import HDF5Matrix”

I just reinstalled python into my system with all necessary modules. 我只是将python和所有必需的模块重新安装到我的系统中。 But when I run a program with the import statement from keras.utils import HDF5Matrix , it is giving attribute error. 但是,当我使用from keras.utils import HDF5Matrix的import语句运行程序时,它给出了属性错误。 The place where the error is coming is: File "h5py\\h5r.pxd", line 21, in init h5py._conv File "h5py\\h5r.pyx", line 145, in init h5py.h5r . 错误发生的地方是: File "h5py\\h5r.pxd", line 21, in init h5py._conv File "h5py\\h5r.pyx", line 145, in init h5py.h5r But when I run the same statement in the IDLE directly, it is not giving any error. 但是,当我直接在IDLE中运行同一条语句时,它没有给出任何错误。 So, what is the cause of error. 那么,错误的原因是什么。 I have not posted my code because most of it is irrelevant as the Interpreter is not going past the import statement. 我没有发布代码,因为大多数代码都无关紧要,因为解释器不会超出import语句。 Also, before I reinstalled Python, the code was working fine. 另外,在我重新安装Python之前,代码工作正常。 So, what can be the problem. 那么,可能是什么问题。

I got the solution. 我找到了解决方案。 It was because I was importing both HDF5Matrix and tables in same program. 这是因为我在同一程序中同时导入了HDF5Matrix和表。 Due to some reason both cannot be imported in same program. 由于某些原因,两者都不能导入同一程序中。 I think it is because both make use of h5py in backend, so importing both is causing some conflict. 我认为这是因为两者都在后端使用了h5py,因此两者都导入会引起一些冲突。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError: type object 'h5py.h5r.Reference' 没有属性 '__reduce_cython__' - AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__' AttributeError: type object 'h5py.h5.H5PYConfig' has no attribute '__reduce_cython__', while using Tensorflow Object 检测API - AttributeError: type object 'h5py.h5.H5PYConfig' has no attribute '__reduce_cython__', while using Tensorflow Object detection API 无法从 keras.utils 导入“HDF5Matrix” - Can't import 'HDF5Matrix' from keras.utils 导入 modin.pandas 导致错误:AttributeError:类型 object 'pyarrow.lib.Message' 没有属性 '__reduce_cython__' - import modin.pandas causes ERROR: AttributeError: type object 'pyarrow.lib.Message' has no attribute '__reduce_cython__' AttributeError: 类型对象 'sklearn.tree._tree.TreeBuilder' 没有属性 '__reduce_cython__' - AttributeError: type object 'sklearn.tree._tree.TreeBuilder' has no attribute '__reduce_cython__' AttributeError:类型 object 'netCDF4._netCDF4._MemBuf' 没有属性 '__reduce_cython__' - AttributeError: type object 'netCDF4._netCDF4._MemBuf' has no attribute '__reduce_cython__' AttributeError:类型对象“sklearn.manifold._barnes_hut_tsne.array”没有属性“__reduce_cython__” - AttributeError: type object 'sklearn.manifold._barnes_hut_tsne.array' has no attribute '__reduce_cython__' AttributeError:类型对象“sklearn.tree._criterion.array”没有属性“__reduce_cython__” - AttributeError: type object 'sklearn.tree._criterion.array' has no attribute '__reduce_cython__' AttributeError:类型 object 'pandana.cyaccess.cyaccess' 没有属性 '__reduce_cython__' - AttributeError: type object 'pandana.cyaccess.cyaccess' has no attribute '__reduce_cython__' importefficientnet.keras as efn - AttributeError: module 'keras.utils' has no attribute 'generic_utils' - import efficientnet.keras as efn - AttributeError: module 'keras.utils' has no attribute 'generic_utils'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM