from timm.models.layers import to_2tuple,to_3tuple # 导入 a = 224 b = to_2tuple(a) c = to_3tuple(a) print("a:{},b:{},c:{}".format(a,b,c)) print(type(a),type(b)) 结果 a:224,b:(224, 224),c:(224, 224, 224) <class 'int'> <class 'tuple'>发布...