0

I have a function which is supposed to unpack an H5PY dataset, temp.hdf5, which only contains one example so it can be evaluated:

def getprob():
    test_set = H5PYDataset('temp.hdf5', which_sets=('test',))
    handle = test_set.open()
    test_data = test_set.get_data(handle, slice(0,1))
    xx = test_data[0]
    YY = test_data[1]
    l, prob, rho_orig, rho_larger, rho_largest = f(xx)
    return prob[9][0]

Where test_data[0] is 28x28 array of integers and test_data[1] is an integer between 0 and 9.

The problem is that, from within the function, test_data[0] is always a 28x28 array of zeros, even though it is not within 'temp.hdf5'. test_data[1] always loads properly, though.

When these lines of code are run outside of the function, everything works just fine.

What is going on here?

  • What module are you using? Your function calls don't look like `h5py`. – hpaulj Dec 28 '16 at 19:00
  • using H5PYDataset, from fuel.datasets.hdf5. The only function call pertaining to this are the first three of the function. They are straight from the fuel documentation. – Malcolm Regan Dec 28 '16 at 19:52
  • sorry, wont let me edit: "The only lines using this module are the first three lines of the getprob() function" – Malcolm Regan Dec 28 '16 at 19:53

0 Answers0