Subset instances cannot be defined by a slice

23 views
Skip to first unread message

曾華瑋

unread,
Dec 19, 2016, 10:26:22 AM12/19/16
to fuel-users

Hello guys!

May i ask some question about dcgan_code.......


Because I got this error when I run the faces file train_uncond_dcgan.py but i don't know how to fix it....  :(
and this is it's Traceback.....
"
Traceback (most recent call last):
File "train_uncond_dcgan.py", line 52, in 
tr_data, te_data, tr_stream, val_stream, te_stream = faces(ntrain=ntrain)
File "/home/jerry/dcgan_code/faces/load.py", line 14, in faces
te_data = H5PYDataset(path, which_sets=('test',))
File "/home/jerry/anaconda2/lib/python2.7/site-packages/fuel-0.2.0-py2.7-linux-x86_64.egg/fuel/datasets/hdf5.py", line 197, in init
self.num_examples)
File "/home/jerry/anaconda2/lib/python2.7/site-packages/fuel-0.2.0-py2.7-linux-x86_64.egg/fuel/datasets/hdf5.py", line 504, in num_examples
return self.subsets[0].num_examples
File "/home/jerry/anaconda2/lib/python2.7/site-packages/fuel-0.2.0-py2.7-linux-x86_64.egg/fuel/utils/init.py", line 441, in lazy_property_getter
self.load()
File "/home/jerry/anaconda2/lib/python2.7/site-packages/fuel-0.2.0-py2.7-linux-x86_64.egg/fuel/datasets/hdf5.py", line 465, in load
subsets = self.get_subsets(handle, self.which_sets, self.sources)
File "/home/jerry/anaconda2/lib/python2.7/site-packages/fuel-0.2.0-py2.7-linux-x86_64.egg/fuel/datasets/hdf5.py", line 448, in get_subsets
slice(row['start'], row['stop']), len(h5file[source]))
File "/home/jerry/anaconda2/lib/python2.7/site-packages/fuel-0.2.0-py2.7-linux-x86_64.egg/fuel/utils/init.py", line 53, in init
self._subset_sanity_check(list_or_slice, original_num_examples)
File "/home/jerry/anaconda2/lib/python2.7/site-packages/fuel-0.2.0-py2.7-linux-x86_64.egg/fuel/utils/init.py", line 313, in _subset_sanity_check
self._slice_subset_sanity_check(list_or_slice, num_examples)
File "/home/jerry/anaconda2/lib/python2.7/site-packages/fuel-0.2.0-py2.7-linux-x86_64.egg/fuel/utils/init.py", line 338, in _slice_subset_sanity_check
raise ValueError('Subset instances cannot be defined by a slice '
ValueError: Subset instances cannot be defined by a slice whose start value is greater than or equal to the original number of examples
"

I don't understand what kind of this problem....
Can anybody help me to solve it? PLEASE!!!

My hdf5 file is built by 128 pics 64643 faces jpeg photos......

Vincent Dumoulin

unread,
Jan 12, 2017, 3:59:31 PM1/12/17
to fuel-users
Hi,
Without some way to reproduce the error message you're getting it'll be hard to pinpoint what exactly went wrong. Could you provide the code that raised this error?
Reply all
Reply to author
Forward
0 new messages