krumo / Detectron-DA-Faster-RCNN

Domain Adaptive Faster R-CNN in Detectron
Apache License 2.0
50 stars 14 forks source link

Get error when training with custom dataset #18

Open anhquan075 opened 3 years ago

anhquan075 commented 3 years ago

Hello, I try to train DA-Faster RCNN with my custom dataset using the VGG16 model but got some errors when it train, How can I fix it ?

...
...
[E net_async_base.cc:145] Rethrowing exception from the run of 'generalized_rcnn'
WARNING workspace.py: 234: Original python traceback for operator `143` in network `generalized_rcnn` in exception above (most recent call last):
WARNING workspace.py: 239:   File "tools/train_net.py", line 132, in <module>
WARNING workspace.py: 239:   File "tools/train_net.py", line 114, in main
WARNING workspace.py: 239:   File "/workingspace/detectron/utils/train.py", line 53, in train_model
WARNING workspace.py: 239:   File "/workingspace/detectron/utils/train.py", line 145, in create_model
WARNING workspace.py: 239:   File "/workingspace/detectron/modeling/model_builder.py", line 125, in create
WARNING workspace.py: 239:   File "/workingspace/detectron/modeling/model_builder.py", line 90, in generalized_rcnn
WARNING workspace.py: 239:   File "/workingspace/detectron/modeling/model_builder.py", line 241, in build_generic_detection_model
WARNING workspace.py: 239:   File "/workingspace/detectron/modeling/optimizer.py", line 40, in build_data_parallel_model
WARNING workspace.py: 239:   File "/workingspace/detectron/modeling/optimizer.py", line 63, in _build_forward_graph
WARNING workspace.py: 239:   File "/workingspace/detectron/modeling/model_builder.py", line 193, in _single_gpu_build_func
WARNING workspace.py: 239:   File "/workingspace/detectron/modeling/rpn_heads.py", line 51, in add_generic_rpn_outputs
WARNING workspace.py: 239:   File "/workingspace/detectron/modeling/rpn_heads.py", line 133, in add_single_scale_rpn_losses
WARNING workspace.py: 239:   File "/workingspace/detectron/modeling/detector.py", line 407, in MaskingInput
Traceback (most recent call last):
  File "tools/train_net.py", line 132, in <module>
    main()
  File "tools/train_net.py", line 114, in main
    checkpoints = detectron.utils.train.train_model()
  File "/workingspace/detectron/utils/train.py", line 67, in train_model
    workspace.RunNet(model.net.Proto().name)
  File "/usr/local/lib/python3.6/dist-packages/caffe2/python/workspace.py", line 266, in RunNet
    StringifyNetName(name), num_iter, allow_fail,
  File "/usr/local/lib/python3.6/dist-packages/caffe2/python/workspace.py", line 227, in CallWithExceptionIntercept
    return func(*args, **kwargs)
  File "/workingspace/detectron/ops/generate_proposal_labels.py", line 52, in forward
    fast_rcnn_roi_data.add_fast_rcnn_blobs(blobs, im_scales, roidb)
  File "/workingspace/detectron/roi_data/fast_rcnn.py", line 121, in add_fast_rcnn_blobs
    frcn_blobs = _sample_rois(entry, im_scales[im_i], im_i)
  File "/workingspace/detectron/roi_data/fast_rcnn.py", line 186, in _sample_rois
    roidb['bbox_targets'][keep_inds, :]
  File "/workingspace/detectron/roi_data/fast_rcnn.py", line 291, in _expand_bbox_targets
    bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]
ValueError: could not broadcast input array from shape (4) into shape (0)