Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to operate visual hdf5 files with python

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "python how to operate visualization hdf5 files", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "python how to operate visualization hdf5 files" article.

HDF5 file is a special set of file formats used to store and organize a large amount of data, which has excellent characteristics in the storage and operation of a large number of scientific data. But it is not easy to read and manipulate when stored as a data format.

What is a HDF5 file?

For some complex hdf5 files, the internal structure of the files can be easily understood by visualization. Here is how to install and use a hdf5 file based on python.

1 install the vitables toolkit

Command pip install vitables

2 use commands in the terminal after installation is complete

Vitables file name. hdf5

Finally, the visualization of hdf5 files is realized, which is convenient and intuitive, just like opening folders layer by layer.

Python for the operation of HDF5 import h6py # Import Toolkit import numpy as np # HDF5 write: imgData = np.zeros ((30Mae 3128256)) f = h6py.File ('HDF5_FILE.h6','w') # create an H6 file The file pointer is f f ['data'] = imgData # under the primary key data to write data to the file f [' labels'] = range (100) # to write data to the file under the primary key labels f.close () # close the reading of file # HDF5: F = h6py.File ('HDF5_FILE.h6' 'r') # Open the h6 file f.keys () # to see all the primary keys: here is: [data] [label] a = f ['data'] [:] # take out all the key values f.close () of which the primary key is f.close () several solutions to the problem of hdf5 error in python environment (personal test) 1. The contents of the error report are as follows:

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

II. Several solutions

First of all, this problem may be a hdf5 library mismatch, or it may be something similar to warning, which I will talk about in more detail below.

The first solution:

Uninstall hdf5 and then reinstall it.

The code executed by the terminal is as follows:

Conda uninstall hdf5conda install hdf5

On the Internet, there are many friends who use this method to be useful, I personally test: the method is useless to me.

The second solution:

Check the set path: LD_LIBRARY_PATH

I personally test: because the system I use is win10, but I have been looking for the path of LD_LIBRARY_PATH for a long time, I can't find it. Later, I searched and found Linux, so I didn't use this method.

The third solution:

Set HDF5_DISABLE_VERSION_CHECK to a higher level and ignore warnings.

Before import tensorflow, add the following code to the code:

Import os;os.environ ['HDF5_DISABLE_VERSION_CHECK'] =' 2'

My own test: this method is really useful!

The above is about the content of this article on "how to operate visual hdf5 files in python". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report