uzh-rpg / DSEC

MIT License
128 stars 16 forks source link

OSError: Can't read data (can't open directory) #44

Closed codefwer closed 1 year ago

codefwer commented 1 year ago

when i want to read events from events.h5 by usingh5py ,i met this error:

 File "f:/event_data/DSEC/DSEC-main/test.py", line 32, in <module>
    for data in temp['events']['p']:
  File "E:\anaconda\envs\pytorch\lib\site-packages\h5py\_hl\dataset.py", line 695, in __iter__
    yield self[i]
  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 "E:\anaconda\envs\pytorch\lib\site-packages\h5py\_hl\dataset.py", line 741, in __getitem__
    return self._fast_reader.read(args)
  File "h5py\_selector.pyx", line 370, in h5py._selector.Reader.read
OSError: Can't read data (can't open directory)

this is my code

temp = h5py.File(r'F:\event_data\DSEC\thun_01_a_events_right\events.h5')
print(temp['events']['p'][:])

i am sure that i download the correct data from the website, so could you please give me some solutions?

magehrig commented 1 year ago

Hi @codefwer

Can you give me some more information:

magehrig commented 1 year ago

@codefwer

Not sure if you still have this issue. I just realized that you have a small error. It should be:

temp['events/p'][:]

Following the convention in the code.

codefwer commented 1 year ago

@magehrig I sorry to reply late I installed hdf5plugin then importit ,the error disappeared