title: slice indices must be integers or None or have an __index__ method in udacity self driving
body: <p>in udacity self driving <a href="https://github.com/udacity/self-driving-car/tree/master/vehicle-detection/u-net" rel="nofollow noreferrer">https://github.com/udacity/self-driving-car/tree/master/vehicle-detection/u-net</a> the method get_mask_seg(img, bb_boxes_f) gives slice indices must be integers or none or have an <strong>index</strong> method</p>
  
  <pre><code>&lt;ipython-input-58-b0cc385c742b&gt; in &lt;module&gt;()
        2 
        3 training_gen = generate_train_batch(df_vehicles,10)
  ----&gt; 4 batch_img,batch_mask = next(training_gen)
  
  &lt;ipython-input-55-1399e4d6a92a&gt; in generate_train_batch(data, batch_size)
       12                                                    scale_range=50
       13                                                   )
  ---&gt; 14             img_mask = get_mask_seg(img,bb_boxes)
       15             batch_images[i_batch] = img
       16             batch_masks[i_batch] =img_mask
  
  &lt;ipython-input-51-b5ad142378f0&gt; in get_mask_seg(img, bb_boxes_f)
        8         bb_box_i = [bb_boxes_f.iloc[i]['xmin'],bb_boxes_f.iloc[i]['ymin'],
        9                 bb_boxes_f.iloc[i]['xmax'],bb_boxes_f.iloc[i]['ymax']]
  ---&gt; 10         img_mask[bb_box_i[1]:bb_box_i[3],bb_box_i[0]:bb_box_i[2]]= 1
       11         img_mask = np.reshape(img_mask,(np.shape(img_mask)[0],np.shape(img_mask)[1],1))
       12     return img_mask
  
  TypeError: slice indices must be integers or None or have an __index__ method
  </code></pre>