关于python环境中hdf5报错问题的几种解决办法(亲测)

关于python环境中hdf5报错问题的几种解决办法(亲测)
一 报错内容如下:
Warning! HDF5 library version mismatched error
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.

Data corruption or segmentation faults may occur if the application continues.

This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.

You should recompile the application or check your shared library related
settings such as ‘LD_LIBRARY_PATH’.

You can, at your own risk, disable this warning by setting the environment
variable ‘HDF5_DISABLE_VERSION_CHECK’ to a value of ‘1’.

Setting it to 2 or higher will suppress the warning messages totally.

Headers are 1.10.4, library is 1.10.5

二 几种解决办法
首先,这个问题是有可能是hdf5库不匹配的问题,也有可能是一个类似warning的东西,下面我会详细的说一下。
第一种解决办法:卸载hdf5,然后重新安装。
终端执行的代码如下:
conda uninstall hdf5
conda install hdf5
网上有好多朋友用这个方法有用, 本人亲测:方法对我无用。
第二种解决办法:检查一下设置的路径:LD_LIBRARY_PATH
本人亲测:由于我使用的系统是win10,但是LD_LIBRARY_PATH这个路径我找了 好半天也找不到,后来搜索一下发现时Linux的,所以这个方法我没有使用。
第三种解决办法:将HDF5_DISABLE_VERSION_CHECK设置为更高等级,忽略警告。
在import tensorflow之前,在代码中添加如下代码:
import os;
os.environ[‘HDF5_DISABLE_VERSION_CHECK’] = ‘2’
本人亲测:此方法着实有用!

Original: https://blog.csdn.net/ow147258369/article/details/115659345
Author: 天蝎美男oldwang
Title: 关于python环境中hdf5报错问题的几种解决办法(亲测)

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/520991/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球