确保你的PyTorch版本支持CUDA,并且你的GPU和驱动程序都兼容当前的CUDA版本。 可以通过运行 torch.cuda.is_available() 来检查CUDA是否可用。 检查自定义算子: 如果sigmoid_focal_loss_forward_impl 是一个自定义的CUDA算子,确保你已经正确编译了这个算子,并且编译后的库文件(如 .so 或.dll)已经正确加载。 检查编译...
Added a condition to check ifalpha > 1. If true, it raises aValueError. Clarified in the docstring that valid values ofalphaare within(0, 1)or-1for ignoring. Reasoning According to the focal loss paper and its implementations,alphain the range of(0, 1)(or-1) is standard practice. Ens...