Yolov5-distillation-train-inference icon indicating copy to clipboard operation
Yolov5-distillation-train-inference copied to clipboard

报错:RuntimeError: The size of tensor a (80) must match the size of tensor b (44) at non-singleton dimension 3,这个维度对不上要改哪里呢

Open tengfei1998 opened this issue 3 years ago • 2 comments

tengfei1998 avatar Sep 21 '22 13:09 tengfei1998

会改了吗 蹲

chairman-lu avatar Nov 16 '23 12:11 chairman-lu

嗨嗨嗨兄弟我找到错了,44应该是你用的数据集的class数量吧 image 在teacher.py里面,teacher模型在初始化的时候根本没用到nc参数,所以默认直接用的80,所以前向传播出来的值的那个维度就是80。所以把teacher.py里的初始化按照train_distill里面初始化student模型的方法重写一遍就好了

chairman-lu avatar Nov 16 '23 13:11 chairman-lu