Theano error when running Quick example

Posted in General by Luis A. Molina Sun Jun 12 2016 02:03:03 GMT+0000 (Coordinated Universal Time)·3·Viewed 5,695 times

When running the Quick example of the MLP on the MNIST data I am getting the following error when running on Python 3.5: Using gpu device 0: GeForce GT 650M (CNMeM is disabled, cuDNN not available) Getting data... Creating model... Training... Traceback (most recent call last): File "<ipython-input-2-360694695dce>", line 1, in <module> runfile('/Users/molinal/SkyDrive/AI/opendeep/', wdir='/Users/molinal/SkyDrive/AI/opendeep') File "/Users/molinal/anaconda/envs/tensorflow/lib/python3.5/site-packages/spyderlib/widgets/externalshell/", line 699, in runfile execfile(filename, namespace) File "/Users/molinal/anaconda/envs/tensorflow/lib/python3.5/site-packages/spyderlib/widgets/externalshell/", line 88, in execfile exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace) File "/Users/molinal/SkyDrive/AI/opendeep/", line 34, in <module> optimizer.train() File "/Users/molinal/OpenDeep/opendeep/optimization/", line 380, in train self.STOP = self._perform_one_epoch(f_learn, plot) File "/Users/molinal/OpenDeep/opendeep/optimization/", line 422, in _perform_one_epoch _outs = raise_to_list(f_learn(*batch)) File "/Users/molinal/anaconda/pkgs/theano/compile/", line 786, in __call__ allow_downcast=s.allow_downcast) File "/Users/molinal/anaconda/pkgs/theano/tensor/", line 177, in filter data.shape)) TypeError: ('Bad input argument to theano function with name "f_learn" at index 0(0-based)', 'Wrong number of dimensions: expected 2, got 4 with shape (100, 1, 28, 28).')
June 12, 2016

Forgot to update the example! MNIST is now 2D by default, this example assumes 1D. You have to initialize MNIST now with flatten=True argument.

marked this as solved
June 12, 2016

That fixed the issue! Thank you.

Markdown is allowed