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

File "./MELM-master/tools/../lib/nets/network.py", line 384, in get_refine_supervision roi_weights[:, 0] = max_box_score[gt_assignment, 0] ValueError: could not broadcast input array from shape (761) into shape (500) #5

Open
nawang0226 opened this issue Apr 5, 2019 · 3 comments

Comments

@nawang0226
Copy link

Hi, following the ReadMe, whatever it just doesn't work and I don't know how to fix it. The problem is

  • voc_2007_trainval ss roidb loaded from /data3/CV_WN/MELM-master/data/cache/voc_2007_trainval_selective_search_roidb.pkl
    done
    Preparing training data...
    done
    10022 roidb entries
    Output will be saved to /data3/CV_WN/MELM-master/output/vgg16/voc_2007_trainval/default
    TensorFlow summaries will be saved to /data3/CV_WN/MELM-master/tensorboard/vgg16/voc_2007_trainval/default
    Loaded dataset voc_2007_test for training
    Set proposal method: selective_search
    Preparing training data...
    voc_2007_test ss roidb loaded from /data3/CV_WN/MELM-master/data/cache/voc_2007_test_selective_search_roidb.pkl
    done
    4952 validation roidb entries
    Filtered 0 roidb entries: 10022 -> 10022
    Filtered 0 roidb entries: 4952 -> 4952
    Solving...
    Loading initial model weights from data/imagenet_weights/vgg16.pth
    Loaded.
    Traceback (most recent call last):
    File "./tools/trainval_net.py", line 130, in
    max_iters=args.max_iters)
    File "/data3/CV_WN/MELM-master/tools/../lib/model/train_val.py", line 357, in train_net
    sw.train_model(max_iters)
    File "/data3/CV_WN/MELM-master/tools/../lib/model/train_val.py", line 265, in train_model
    self.net.train_step_with_summary(blobs, self.optimizer)
    File "/data3/CV_WN/MELM-master/tools/../lib/nets/network.py", line 727, in train_step_with_summary
    self.forward(blobs['data'], blobs['image_level_labels'],blobs['im_info'], blobs['gt_boxes'], blobs['ss_boxes'])
    File "/data3/CV_WN/MELM-master/tools/../lib/nets/network.py", line 633, in forward
    self._add_losses() # compute losses
    File "/data3/CV_WN/MELM-master/tools/../lib/nets/network.py", line 250, in _add_losses
    self._image_gt_summaries['image_level_label'])
    File "/data3/CV_WN/MELM-master/tools/../lib/nets/network.py", line 384, in get_refine_supervision
    roi_weights[:, 0] = max_box_score[gt_assignment, 0]
    ValueError: could not broadcast input array from shape (761) into shape (500)

Thanks for all have you done and look forward to your early reply to this problem.

@zwy1996
Copy link

zwy1996 commented Apr 6, 2019

Hi, I met the same error, did you handle it?

@nawang0226
Copy link
Author

no, haven't handle it.

@vasgaowei
Copy link
Owner

I am sorry, last week I made a update for supporting varied numbers of ROIs for forward operations in case of not enough GPU memory. And you can fix the bugs as following:
in network.py file, in _add_losses functions, in lines 244, change to self.get_refine_supervision(det_cls_product, self._image_gt_summaries['ss_boxes'][self.ss_boxes_indexes ,:],self._image_gt_summaries['image_level_label']). And for line 257 do the same operation. And I will fix this small bugs soon.

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

3 participants