You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/01 13:31:36 UTC

[GitHub] CXMA479 commented on issue #8663: terminate called after throwing an instance of 'std::out_of_range?

CXMA479 commented on issue #8663: terminate called after throwing an instance of 'std::out_of_range?
URL: https://github.com/apache/incubator-mxnet/issues/8663#issuecomment-354301365
 
 
   similar problem has been spotted, as i tried to execute some code like this:
   **Version 0.11.1**
   
   ```python
   def gen_sym(seq_len):
       data=mx.sym.Variable('data')
       label = mx.sym.Variable('label')  # NT
       output, _ = stack.unroll(seq_len, inputs=data, merge_outputs=False, layout='NT')
       pred = output[seq_len-1]
       pred = mx.sym.reshape(pred, shape=(batch_size,-1))
       pred_e = mx.sym.FullyConnected(data= pred, num_hidden=1)
       sym = mx.sym.broadcast_add(pred_e, label)
       sym = mx.sym.MakeLoss(sym)
       return sym, ('data', ), ('label', )
   ```
   However, if i replace `pred_e` with `pred` in *broadcast_add* it works fine
   
   # Error info
   ```
   terminate called after throwing an instance of 'std::out_of_range'
     what():  _Map_base::at
   Aborted (core dumped)
   ```
   
   The point where this error occurs seems to be unpredictable. It could be thrown out before executing `forward` or after several loops of `update`
   I added one line to print in the **1st** line of the `forward_backward` function in `base_module.py`, some results were like this:
   ```shell
   ################## SAMPLE 1  ######################
   $ python main.py 
   WARNING: discarded 0 sentences longer than the largest bucket.
   WARNING: discarded 0 sentences longer than the largest bucket.
   begin one forward_backward, data_batch shape: (10L, 9L)
   begin one forward_backward, data_batch shape: (10L, 9L)
   begin one forward_backward, data_batch shape: (10L, 9L)
   [xxxx-xx-xx 21:19:07,066] {/usr/local/lib/python2.7/dist-packages/mxnet-0.11.1-py2.7.egg/mxnet/callback.py:166} INFO - Epoch[0] Batch [2]	Speed: 188.98 samples/sec	mse=0.329261
   begin one forward_backward, data_batch shape: (10L, 9L)
   begin one forward_backward, data_batch shape: (10L, 9L)
   terminate called after throwing an instance of 'std::out_of_range'
     what():  _Map_base::at
   Aborted (core dumped)
   ################## SAMPLE 2  ######################
   $ python main.py 
   WARNING: discarded 0 sentences longer than the largest bucket.
   WARNING: discarded 0 sentences longer than the largest bucket.
   begin one forward_backward, data_batch shape: (10L, 6L)
   terminate called after throwing an instance of 'std::out_of_range'
     what():  _Map_base::at
   Aborted (core dumped)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services