问题
I'm having problems opening .h5 files.
I've googled around and messed about with keras but still no luck.
Here's my code :-
and this is giving me an error of :-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import h5py
""" Reading Data from Files """
plt.close('all')
#File No.
Q = str(4)
""" Position """
with h5py.File('Data_No'+Q+'/Position_No'+Q+'.h5', 'r') as hf:
Position = hf['Position_Data'][:]
And its giving an error which i have no idea whats going wrong :-
Traceback (most recent call last):
File "/media/gerwyn/Gerwyns_Files/Work/PLF/Animation.py", line 20, in
with h5py.File('Data_No'+Q+'/Position_No'+Q+'.h5', 'r') as hf:
File "/home/gerwyn/Documents/anaconda2/lib/python2.7/site-
packages/h5py/_hl/files.py", line 271, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/home/gerwyn/Documents/anaconda2/lib/python2.7/site-
packages/h5py/_hl/files.py", line 101, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 78, in h5py.h5f.open
IOError: Unable to open file (File signature not found)
Can someone please help me in my little predicament ?
Thanks :D
来源:https://stackoverflow.com/questions/46974600/h5py-ioerror-unable-to-open-file-file-signature-not-found