title: How can I create a image classification model?
body: <p>I'm new in Deep Learning and I had a problem I could not figure out for 5 days. So I am in a great disappointment. I need some help, point or something etc.</p>
  
  <p>I'm trying to create a image classification model, the model looks 2 images and decide one hot 9 lenght array. like:</p>
  
  <blockquote>
    <p>[0,1,0,0,0,0,0,0,0]</p>
  </blockquote>
  
  <p>and two images has size 480x720 pixels.</p>
  
  <p>I did try several things but compiler always saying me that </p>
  
  <blockquote>
    <p>ValueError: setting an array element with a sequence.</p>
  </blockquote>
  
  <p>When I creating traning data,</p>
  
  <pre><code>training_data = []
  ...
  while(loop):
      ...
      training_data.append([image1,image2, output])
      ...
      if(...):
           np.save('train_data.npy', training_data)
  </code></pre>
  
  <p>And when I reading data,</p>
  
  <pre><code>train = np.load('train_data.npy')
  X=train[:,:2]
  Y=train[:,2]
  
  for i in range(0,len(X)):
      X[i][0] = X[i][0].reshape(-1,480,720,1)
      X[i][1] = X[i][0].reshape(-1,480,720,1)
  
  
  WIDTH = 480
  HEIGHT = 720
  LR = 1e-3
  EPOCHS = 10
  OUTPUT_SHAPE= 9
  
  model = alexnetf(WIDTH, HEIGHT,LR,OUTPUT_SHAPE)
  model.fit(X, Y, n_epoch=EPOCHS, validation_split=0.1, snapshot_step=500,  show_metric=True, run_id=MODEL_NAME)
  </code></pre>
  
  <p>I can't see any wrong for 5 days, but it doesn't working. I really need any hit, idea etc...</p>
  
  <h1>plus, if you are wondering</h1>
  
  <p>for creating train data</p>
  
  <pre><code>print(type(image1)) #-&gt;(gives as output) &lt;class 'numpy.ndarray'&gt;
  print(image1.shape) #-&gt; (480, 720)
  print(type(image2)) #-&gt; &lt;class 'numpy.ndarray'&gt;
  print(image2.shape) #-&gt; (480, 720)
  print(type(output)) #-&gt; &lt;class 'list'&gt;
  print(len(output))  #-&gt; 9
  </code></pre>
  
  <p>for creating model</p>
  
  <pre><code>print(X.shape) #-&gt;(gives as output) (1200, 2)
  print(X[0].shape) #-&gt; (2,)
  print(X[0,0].shape) #-&gt; (1, 480, 720, 1)
  print(Y.shape) #-&gt; (1200,)
  </code></pre>
  
  <p>alexnet:</p>
  
  <pre><code>import tflearn
  from tflearn.layers.conv import conv_2d, max_pool_2d
  from tflearn.layers.core import input_data, dropout, fully_connected
  from tflearn.layers.estimator import regression
  from tflearn.layers.normalization import local_response_normalization
  
  def alexnet(width, height, lr, output):
      network = input_data(shape=[None, width, height, 1], name='input')
      network = conv_2d(network, 96, 11, strides=4, activation='relu')
      network = max_pool_2d(network, 3, strides=2)
      network = local_response_normalization(network)
      network = conv_2d(network, 256, 5, activation='relu')
      network = max_pool_2d(network, 3, strides=2)
      network = local_response_normalization(network)
      network = conv_2d(network, 384, 3, activation='relu')
      network = conv_2d(network, 384, 3, activation='relu')
      network = conv_2d(network, 256, 3, activation='relu')
      network = max_pool_2d(network, 3, strides=2)
      network = local_response_normalization(network)
      network = fully_connected(network, 4096, activation='tanh')
      network = dropout(network, 0.5)
      network = fully_connected(network, 4096, activation='tanh')
      network = dropout(network, 0.5)
      network = fully_connected(network, output, activation='softmax')
      network = regression(network, optimizer='momentum',
                           loss='categorical_crossentropy',
                           learning_rate=lr, name='targets')
  
      model = tflearn.DNN(network, checkpoint_path='model_alexnet',
                          max_checkpoints=1, tensorboard_verbose=2, tensorboard_dir='log')
  
      return model
  </code></pre>
  
  <p>fully error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/Joo/PycharmProjects/cv2/create_model.py", line 93, in &lt;module&gt;
      model.fit(X, Y, n_epoch=EPOCHS, validation_split=0.1, snapshot_step=500,  show_metric=True, run_id=MODEL_NAME)
    File "D:\Program files\Anaconda3\lib\site-packages\tflearn\models\dnn.py", line 216, in fit
      callbacks=callbacks)
    File "D:\Program files\Anaconda3\lib\site-packages\tflearn\helpers\trainer.py", line 339, in fit
      show_metric)
    File "D:\Program files\Anaconda3\lib\site-packages\tflearn\helpers\trainer.py", line 818, in _train
      feed_batch)
    File "D:\Program files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 889, in run
      run_metadata_ptr)
    File "D:\Program files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1089, in _run
      np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)
    File "D:\Program files\Anaconda3\lib\site-packages\numpy\core\numeric.py", line 531, in asarray
      return array(a, dtype, copy=False, order=order)
  ValueError: setting an array element with a sequence.
  </code></pre>