Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: zero-size array to reduction operation maximum which has no identity #116

Open
murphypei opened this issue Aug 23, 2018 · 6 comments

Comments

@murphypei
Copy link

Hi all ,

I got a new issue during my training.

2018-08-23 18:12:20,224 - root - INFO - Epoch[0] Batch [1400]   Speed: 7.74 samples/sec RPNAcc=0.944368 RPNLogLoss=0.181685     RPNL1Loss=1.067499      RCNNAcc=0.800806        RCNNLogLoss=0.756302RCNNL1Loss=2.519708
Traceback (most recent call last):
  File "train.py", line 303, in <module>
    main()
  File "train.py", line 299, in main
    train_net(sym, roidb, args)
  File "train.py", line 120, in train_net
    arg_params=arg_params, aux_params=aux_params, begin_epoch=args.start_epoch, num_epoch=args.epochs)
  File "/home/peichao/.virtualenvs/py2/local/lib/python2.7/site-packages/mxnet/module/base_module.py", line 515, in fit
    next_data_batch = next(data_iter)
  File "/home/peichao/code/faster-rcnn/symdata/loader.py", line 183, in next
    data_batch = mx.io.DataBatch(data=self.getdata(), label=self.getlabel(),
  File "/home/peichao/code/faster-rcnn/symdata/loader.py", line 221, in getlabel
    b_label, b_bbox_target, b_bbox_weight = self._as.assign(anchors, b_gt_boxes, b_im_height, b_im_width)
  File "/home/peichao/code/faster-rcnn/symdata/anchor.py", line 138, in assign
    gt_max_overlaps = overlaps.max(axis=0)
  File "/home/peichao/.virtualenvs/py2/local/lib/python2.7/site-packages/numpy/core/_methods.py", line 26, in _amax
    return umr_maximum(a, axis, None, out, keepdims)
ValueError: zero-size array to reduction operation maximum which has no identity

It looks like that no overlap gt box found.

@ijkguo

@ijkguo
Copy link
Owner

ijkguo commented Aug 23, 2018

I think it does no harm to filter out a training image that does not have any label (ground truth boxes).

@murphypei
Copy link
Author

@ijkguo you mean I should filter those no label image before training? I don't know whether the PASCAL VOC 2007 contains such images?

@ijkguo
Copy link
Owner

ijkguo commented Aug 24, 2018

Pascal voc does not have images with no labels. COCO has and they are filtered.

@murphypei
Copy link
Author

@ijkguo But I meet this issue when I used pascal voc dataset

@ijkguo
Copy link
Owner

ijkguo commented Aug 25, 2018

OK. When I did experiment with v6 before making a pull request to MXNet, there was no problem. But it is an easy fix anyway, e556bb4.

@murphypei
Copy link
Author

murphypei commented Aug 27, 2018

@ijkguo Thank you, it's my fault, I reduced images size to 300x500 but didn't change the size of anchors, so there is no anchor after filter out anchors outside the region.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants