I am working on similar problem statement. Could you post what you did next.


On Friday, October 30, 2015 at 1:06:23 PM UTC+5:30, Kasra Babaei wrote:
>
> Ok, I finally managed to train it. Had a lot of problems...
>
> I created a new project, with only 6 images for training, that's all. And 
> I manually created a label set. Here is my code:
>
> #Load_dataset
>
> #Open images
> img_one = Image.open('img_one.jpg').convert('L')
> img_one = numpy.asarray(img_one, dtype='float64') / 256
>
> img_two = Image.open('img_two.jpg').convert('L')
> img_two = numpy.asarray(img_two, dtype='float64') / 256
>
> img_three = Image.open('img_two.jpg').convert('L')
> img_three = numpy.asarray(img_three, dtype='float64') / 256
>
> img_four = Image.open('img_two.jpg').convert('L')
> img_four = numpy.asarray(img_four, dtype='float64') / 256
>
> img_five = Image.open('img_two.jpg').convert('L')
> img_five = numpy.asarray(img_five, dtype='float64') / 256
>
> img_six = Image.open('img_two.jpg').convert('L')
> img_six = numpy.asarray(img_six, dtype='float64') / 256
>
> #put images into a numpy ndarray
> train_set_x_numpy_ndarray = []
> train_set_x_numpy_ndarray.append(img_one)
> train_set_x_numpy_ndarray.append(img_two)
> train_set_x_numpy_ndarray.append(img_three)
> train_set_x_numpy_ndarray.append(img_four)
> train_set_x_numpy_ndarray.append(img_five)
> train_set_x_numpy_ndarray.append(img_six)
> train_set_x_numpy_ndarray = numpy.array(train_set_x_numpy_ndarray)
>
>
> #put labels into a numpy ndarray
> train_set_y_numpy_nd_array = [1,1,1,2,2,2]
> train_set_y_numpy_nd_array = numpy.asarray(train_set_y_numpy_nd_array, 
> dtype='int32')
>
>
> #put both numpy ndarrays arrays into one tuple
> train_set_tuple = (train_set_x_numpy_ndarray, train_set_y_numpy_nd_array)
>
> #Create training arrays
> train_set_x, train_set_y = train_set_tuple 
> train_set_x = train_set_x.reshape(-1,1,192,128)
>
> # Train the network
> nn = net1.fit(train_set_x, train_set_y)
>
> Now, I'm going to create a test set, and try to do prediction. 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to