lisa-lab/pylearn2

CIFAR10 script dtype error

Opened this issue · 1 comments

I receive the following TypeError when I try to import CIFAR10 data via the pylearn2 API:

Traceback (most recent call last):
File "my_binary_net.py", line 27, in
train_set = CIFAR10(which_set="train", start=0, stop=train_set_size)
File "/Users/Jackson/pylearn2/pylearn2/datasets/cifar10.py", line 85, in init
x = numpy.zeros((lenx, self.img_size), dtype=dtype)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

I fixed the error by typecasting lenx, which is originally np.float64, to int:
lenx = int(numpy.ceil((ntrain + nvalid) / 10000.) * 10000)

nouiz commented