# HG changeset patch # User Frederic Bastien # Date 1297199876 18000 # Node ID b0141efbf6a21c36b49f95bd2cfbe17b86971290 # Parent 3823dbfff6cfb4d1f93098245d10e68b1ab56b65 fix loading of sparse utlc dataset when PYLEARN_DATA_ROOT have more then 1 directory. diff -r 3823dbfff6cf -r b0141efbf6a2 pylearn/datasets/utlc.py --- a/pylearn/datasets/utlc.py Tue Feb 08 12:57:15 2011 -0500 +++ b/pylearn/datasets/utlc.py Tue Feb 08 16:17:56 2011 -0500 @@ -116,9 +116,9 @@ :param transfer: If True also return the transfer label """ assert name in ['harry','terry','ule'] - trname,vname,tename = [os.path.join(config.data_root(), - 'UTLC','sparse', - name+'_'+subset+'.npy') + common = os.path.join('UTLC','sparse',name+'_') + trname,vname,tename = [config.get_filepath_in_roots(common+subset+'.npy.gz', + common+subset+'.npy') for subset in ['train','valid','test']] train = load_sparse(trname) valid = load_sparse(vname) @@ -192,6 +192,8 @@ fname = fname+'.gz' assert os.path.exists(fname) f = gzip.open(fname) + elif fname.endswith('.gz'): + f = gzip.open(fname) else: f = open(fname) d = cPickle.load(f)