KeyError: "unable to open object (Symbol table: Can't open object)"

1,284 views
Skip to first unread message

Siva Reddy Gangireddy

unread,
Apr 2, 2013, 8:16:26 AM4/2/13
to h5...@googlegroups.com
Hi,

I got this error when I am trying to print the contents of the h5py file. 

2
Traceback (most recent call last):
  File "weight_save.py", line 25, in <module>
    print f['/dest2'].value.ndim
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  File "h5o.pyx", line 176, in h5py.h5o.open (h5py/h5o.c:2727)
KeyError: "unable to open object (Symbol table: Can't open object)"

Sample code:

import h5py
import numpy

def weight_save(path):

    f = h5py.File(path + 'dset.h5', 'w')
    f['/'+'dset1'] = numpy.zeros((6,4), dtype=numpy.int32)
    f['/'+'dset2'] = numpy.zeros((6,4), dtype=numpy.int32)
    f.close()
    return None

weight_save(path)
f = h5py.File(path + 'dset.h5', 'r')
print f['/dset1'].value.ndim
print f['/dest2'].value.ndim             #Error occurred at this line


Could any one help me to fix this error. Thanks in advance.

-----
Siva


Andrew Collette

unread,
Apr 2, 2013, 10:44:15 AM4/2/13
to h5...@googlegroups.com
Hi Siva,

> print f['/dest2'].value.ndim
> KeyError: "unable to open object (Symbol table: Can't open object)"

It means "/dest2" doesn't exist in the file.

Andrew

Siva Reddy Gangireddy

unread,
Apr 2, 2013, 5:08:52 PM4/2/13
to h5...@googlegroups.com
Hi Andrew,

Thank you very much.

It was typing mistake and I didn't look into it properly.

---
Siva

Reply all
Reply to author
Forward
0 new messages