说明:自定义异常的两种方式
一、抛出异常
def greet(name, city):
if not isinstance(name, str):
raise TypeError("Name must be str")
if not isinstance(city, str):
raise TypeError("Age must be str")
print("My name is %s, and I come from" % (name, ci <weixin_38751905> 上传 | 大小:35kb
说明:实验基于论文: Class-Balanced Loss Based on Effective Number of Samples
Class-balanced-loss代码地址:https://github.com/vandit15/Class-balanced-loss-pytorch
resnet18代码参考链接:https://blog.csdn.net/sunqiande88/article/details/80100891
制作数据集
论文中通过公式n=niuin = n_iu^in= <weixin_38725260> 上传 | 大小:57kb