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

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

Closed
guodanying opened this issue May 27, 2019 · 1 comment

Comments

@guodanying
Copy link

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
Copy link
Owner

@guodanying Sure, you should change 80 to 20.

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