No such file or directory: 'results/test_preds.dat/meta/sizes'

In the redux notebook, after saving the results, the notebook tries to re-load them, in the following line:
preds = load_array(‘results/test_preds.dat’)

my notebook fails with the following error:


IOError Traceback (most recent call last)
in ()
----> 1 preds = load_array(‘results/test_preds.dat’)

/home/ubuntu/as/repos/DL/nbs/utils.pyc in load_array(fname)
84
85 def load_array(fname):
—> 86 return bcolz.open(fname)[:]
87
88

/home/ubuntu/anaconda2/lib/python2.7/site-packages/bcolz/toplevel.pyc in open(rootdir, mode)
131 return bcolz.ctable(rootdir=rootdir, mode=mode)
132 else:
–> 133 return bcolz.carray(rootdir=rootdir, mode=mode)
134
135

bcolz/carray_ext.pyx in bcolz.carray_ext.carray.cinit (bcolz/carray_ext.c:13429)()

bcolz/carray_ext.pyx in bcolz.carray_ext.carray._read_meta (bcolz/carray_ext.c:17967)()

IOError: [Errno 2] No such file or directory: ‘results/test_preds.dat/meta/sizes’

1 Like

That means it can’t find your saved array.

You may need to prefix your load_array param with: path+

Otherwise it’s relying on your being in the same working directory as when you saved it.

I had a lot of trouble debugging the paths to the items.
you could try %pwd before you run the commands just to check where the cell thinks you are in the file structure.

3 Likes

That’s a good idea - although if you always prefix your paths with “path+” then you’ll have absolute paths.