Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIFAR10 script dtype error #1587

Open
jaxony opened this issue Jun 5, 2017 · 1 comment
Open

CIFAR10 script dtype error #1587

jaxony opened this issue Jun 5, 2017 · 1 comment

Comments

@jaxony
Copy link

jaxony commented Jun 5, 2017

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
Copy link
Member

nouiz commented Jun 6, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants