Questions tagged [h5py]

h5py is a NumPy-compatible Python module for handling The Hierarchical Data Format (HDF5) files.

h5py is a NumPy-compatible Python module for handling The Hierarchical Data Format (HDF5) files.

Main features

  • Free (BSD licensed)
  • limited dependencies (Python, NumPy, HDF5 libs.)
  • includes both a low level c-like HDF5 interface and a high level Python/NumPy style interface
  • directly interact with datasets using NumPy metaphors, such as slicing
  • datatypes specified using standard NumPy dtype objects

Some links to get started

1301 questions
-1
votes
1 answer

Reading files with .h5 format and using it in dataset

I have two folders( one for train and one for test) and each one has around 10 files in h5 format. I want to read them and use them in a dataset. I have a function to read them, but I don't know how I can use it to read the file in my class. def…
Aysan
  • 23
  • 4
-1
votes
1 answer

Unable to open .hdf file using h5py in Python

OSError: Unable to open file (file signature not found) I feel that the problem is .hdf file as I don't have .h5 or .hdf5 file. So how to I open .hdf in python?
Aniket
  • 9
  • 1
-1
votes
1 answer

What is the easiest way to load hdf5 chunks to a single variable in python?

Now I have a bunch of hdf5 chunks, their structures are all the same. And I would load them as a whole in python, is there any easiest way? (For now, I'd have to use for loop to load them file by file and then concatenate together, but I believe…
Hangci Du
  • 25
  • 1
  • 5
-1
votes
1 answer

Generator function with h5py doesn't close properly

I am trying to create a generator function to train my machine learning model and yield some images. Basically it goes like that (the minimum to reproduce the error on my side): def generator(hdf5_path: str, primary_keys: list): while True: …
Unic0
  • 341
  • 1
  • 3
  • 19
-1
votes
1 answer

HDF5 file to dictionary

I've a hdf5 file in the below format. {...} represent groups and some have subgroups. download the file with the below link https://drive.google.com/file/d/1f6a0XEPGE4aSEKODVbJ1Q9AUw24Bt9_2/view?usp=sharing {'A': np.array(...), …
-1
votes
1 answer

How to load a keras model file to OpenCV code?

I've created a traffic sign classification model. I need to use it in OpenCV for Video traffic sign detection. How can I do that using a .h5 file Thanks in advance!
-1
votes
1 answer

What is the purpose of optimizer's state_dict in PyToch Big Graph's embedding dataset?

The documentation for PyTorch Big Graph (PBG) states that "An additional dataset may exist, optimizer/state_dict, which contains the binary blob (obtained through torch.save()) of the state dict of the model’s optimizer." When inspecting this…
user876901
  • 21
  • 1
-1
votes
1 answer

write HDF h5 dataset (via h5py) which is a mix of string and numpy list

I have the following two datasets (I have several of these tuples): filename_string: "something" filename_list: [1,2,3,4,5] # this is a numpy array. Id like to know how to write this in a compact format via h5py. The goal is to have the end user…
JohnJ
  • 6,736
  • 13
  • 49
  • 82
-1
votes
1 answer

Is there a way to save each HDF5 data set as a .csv column?

I'm struggling with a H5 file to extract and save data as a multi column csv. as shown in the picture the structure of h5 file consisted of main groups (Genotypes, Positions, and taxa). The main group, Genotypes contains more than 1500 subgroups…
-1
votes
1 answer

Broadcast error HDF5: Can't broadcast (3, 2048, 1, 1) -> (4, 2048, 1, 1)

I have received the following error: TypeError: Can't broadcast (3, 2048, 1, 1) -> (4, 2048, 1, 1) I am extracting features and placing them into a hdf5 dataset like this: array_40 = hdf5_file.create_dataset( …
Ze0ruso
  • 485
  • 4
  • 17
-1
votes
1 answer

AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__'

I am using python 3.6,Tensorflow 1.3, Keras 2.1.2 I was importing Resnet50 and I got this error"ImportError: load_model requires h5py" so I used conda install h5py but then I got this error knowing that the installed version of h5py is 2.9.0enter…
-1
votes
1 answer

how to display elements of arrays in a .mat file in python

This is the first time that I try to work with ".mat" files. I am going to use the data of a ".mat" file, but the elements of the arrays can not be opened. Can any one help me? Since the "*.mat" file is > 7.3, I can not use Scipy.io import numpy as…
Haj Nasser
  • 304
  • 2
  • 14
-1
votes
1 answer

OSError: No such file or directory

When I try to open .h5 file, it shows the following error Traceback (most recent call last): File "C:\Users\VW3ZTWS\PycharmProjects\Data_Collection_and_learnings\venv\lib\site-packages\IPython\core\interactiveshell.py", line 2869, in run_code …
Mari
  • 698
  • 1
  • 8
  • 27
-1
votes
2 answers

importing illustris hdf5 file into numpy array using h5py

I am working on importing a rather large hdf5 file of illustris galaxy simulation code using h5py. I have the file displayed here if anyone wants to see - it is 1.96 GB. https://drive.google.com/file/d/0B1Kj475OJBnuaFBIS2FhTFpvNkk/view?usp=sharing I…
W. Ojanen
  • 1
  • 1
-1
votes
1 answer

How to query a PyTables frame_table saved via a Pandas Dataframe?

I have the following pandas dataframe: import pandas as pd df = pd.read_table('fname.dat') So, I create/ open an existing HDFStore file: store = pd.HDFStore('store.h5') To index a subset of columns, I simply use store.append('key_name', df,…
ShanZhengYang
  • 16,511
  • 49
  • 132
  • 234
1 2 3
86
87