[英]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.