tianzhi0549 / FCOS

FCOS: Fully Convolutional One-Stage Object Detection (ICCV'19)
https://arxiv.org/abs/1904.01355
Other
3.28k stars 630 forks source link

RuntimeError: cannot perform reduction function min on tensor with no elements because the operation does not have an identity #49

Closed guodanying closed 5 years ago

guodanying commented 5 years ago

Traceback (most recent call last): File "tools/train_net.py", line 176, in main() File "tools/train_net.py", line 169, in main model = train(cfg, args.local_rank, args.distributed) File "tools/train_net.py", line 75, in train arguments, File "/home/administrator/FCOS/maskrcnn_benchmark/engine/trainer.py", line 66, in do_train loss_dict = model(images, targets) File "/home/administrator/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, *kwargs) File "/home/administrator/FCOS/maskrcnn_benchmark/modeling/detector/generalized_rcnn.py", line 50, in forward proposals, proposal_losses = self.rpn(images, features, targets) File "/home/administrator/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, **kwargs) File "/home/administrator/FCOS/maskrcnn_benchmark/modeling/rpn/fcos/fcos.py", line 134, in forward centerness, targets File "/home/administrator/FCOS/maskrcnn_benchmark/modeling/rpn/fcos/fcos.py", line 144, in _forward_train locations, box_cls, box_regression, centerness, targets File "/home/administrator/FCOS/maskrcnn_benchmark/modeling/rpn/fcos/loss.py", line 142, in call labels, reg_targets = self.prepare_targets(locations, targets) File "/home/administrator/FCOS/maskrcnn_benchmark/modeling/rpn/fcos/loss.py", line 57, in prepare_targets points_all_level, targets, expanded_object_sizes_of_interest File "/home/administrator/FCOS/maskrcnn_benchmark/modeling/rpn/fcos/loss.py", line 94, in compute_targets_for_locations is_in_boxes = reg_targets_per_im.min(dim=2)[0] > 0 RuntimeError: cannot perform reduction function min on tensor with no elements because the operation does not have an identity

how can i solve it ?

And i train my own data,i have only 20 classes should i change 80(coco ) to 20 in the network?

tianzhi0549 commented 5 years ago

@guodanying Sure, you should change 80 to 20.