title: How to solve "Incorrectly defined MiniBatchable Datastore" error when training network
body: <p>I'm trying to use a convolutional neural net (designed with MATLAB's Deep Network Designer) to identify flowers from a dataset of images (pretty new to machine learning, haven't taken a course, just playing around with things). I've stored my images and labels in an augmented datastore called auimds, but when I run trainNetwork, I get the following error:</p>
  
  <blockquote>
    <p>Error using trainNetwork (line 150)
    Incorrectly defined MiniBatchable Datastore. Error in read method of C:\Program Files\MATLAB\R2018b\toolbox\matlab\datatypes@table\table.m at line 261: Wrong number of arguments.</p>
    
    <p>Error in trainer (line 2)
    <code>net = trainNetwork(auimds,lgraph_1,options);</code></p>
  </blockquote>
  
  <p>This is the code that produces the error:</p>
  
  <pre><code>options = trainingOptions('sgdm');
  net = trainNetwork(auimds,lgraph_1,options);
  </code></pre>
  
  <p>This is the relevant part of the code that creates auimds. "paths" is a list of paths to images, "labels" is the list of labels, and "folders" is a list of the names of folders containing images. The images are given labels based on their containing folder's name:</p>
  
  <pre><code>counter = 1;
  for i=1:length(paths)
      files = dir(fullfile(paths(i),'*.jpg'));
      for j=1:length(files)
          labels(counter) = folders(i).name;
          counter = counter + 1;
      end
  end
  imds = imageDatastore(paths,'Labels',labels);
  auimds = augmentedImageDatastore([200,200],imds);
  </code></pre>