# Mxnet strange BoundsError

**URL:** https://discourse.julialang.org/t/mxnet-strange-boundserror/10807
**Category:** Machine Learning
**Tags:** mxnetjl, array
**Created:** [May 9, 2018, 11:31pm UTC](https://discourse.julialang.org/t/mxnet-strange-boundserror/10807 "2018-05-09T23:31:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![han-so1omon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/han-so1omon/32/4398_2.png) [@han-so1omon](https://discourse.julialang.org/u/han-so1omon)
#### Post date: [May 9, 2018, 11:31pm UTC](https://discourse.julialang.org/t/mxnet-strange-boundserror/10807/1 "2018-05-09T23:31:06Z")

</div>

Training a network that outputs mxnet.NDArrays shape (27,1). I created a 3d array of labels of shape (27,1,210). Creation of data provider and subsequent training looks like the following:

> navDataIter = mx.ArrayDataProvider(  
> :navData =\> trainingBatch.navBatch[“navInput”],  
> :navLinRegressOut1\_label =\> trainingBatch.navBatch[“navLabel”];  
> batch\_size=trainingBatch.navLength, shuffle=true)  
> mx.fit(nav.neuralParams.navModel,nav.neuralParams.navOptimizer,navDataIter,n\_epoch=20)

BoundsError occurs as such:

> BoundsError: attempt to access 27x1 Array{Float32,2} at index [Base.Slice(Base.OneTo(27)), 2].

It seems like correct array slice notation for a 2D array, except the data has one dimension. Perhaps a copy is created and concatenated for some reason? I’m not sure if this is the correct interpretation of what’s happening. Either way, this error alludes to an incorrect array access syntax.

Edit: It seems like the problem is resolved by using `batch_size=0`.
