How can I customize my data for use in Theano?

1

I'm following the link link tutorial and would like to apply the codes to my own dataset.

As I do not know much about python, I did some searching and found that I needed to put my data in a multidimensional array like in the code below:

import pickle
import Image
import numpy as np
def generateDataset(filesDir):
   x = np.asarray([np.asarray(Image.open(fname)) for fname in filesDir]) #gera array com todas images
   with open('dataset.pickle', 'wb') as handle:
       pickle.dump( x, handle, protocol=2) #salva como .pkl

However, when I loaded the file using cPickle and sent as a parameter of the method used in the examples, I get the error:

The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Which makes me believe that this is not the correct way to adapt my data to those used in the code. Does anyone know how I can tailor my data to used in this example, or how do I use my own dataset in Theano?

Some extra information: The dataset used in the book is mnist and my images are 320x320 gray.

Note: The github with the codes used are in the first link

Thank you in advance.

    
asked by anonymous 28.03.2017 / 23:47

0 answers