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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM