RuntimeError: reciprocal is not implemented for type torch.cuda.LongTensor

运行Faster rcnn FPN网络,出现的bug:
RuntimeError: reciprocal is not implemented for type torch.cuda.LongTensor

 解决办法: anchor_target_layer_fpn.py", line 136:

            num_examples = torch.sum(labels[i] >= 0)
            num_examples = num_examples.float() 
            positive_weights = 1.0 / num_examples
            negative_weights = 1.0 / num_examples

ref:https://blog.csdn.net/qq_43088746/article/details/100422779

posted @ 2020-04-01 20:09  Wind·Chaser  阅读(1029)  评论(0编辑  收藏  举报