HankYe / PAGCP

PAGCP for the compression of YOLOv5
GNU General Public License v3.0
111 stars 11 forks source link

TypeError: cannot unpack non-iterable NoneType object #22

Open 7W7W7W opened 1 month ago

7W7W7W commented 1 month ago

您好,感谢您的工作,我在改进后的模型中使用您的方法后出现以下错误,请问这个怎么处理呢?谢谢!

Traceback (most recent call last): File "f:/yolov5-7.0/compress.py", line 612, in main(opt) File "f:/yolov5-7.0/compress.py", line 592, in main train(opt.hyp, opt, device, callbacks) File "f:/yolov5-7.0/compress.py", line 251, in train pruned_model = compress(model, val_loader if RANK in [-1, 0] else None, opt) File "f:/yolov5-7.0/compress.py", line 88, in compress sendict = sens(model, dataloader, args.part) File "f:\yolov5-7.0\prune\sensitivity.py", line 348, in call , _, base_flops = self.model.cuda().info(False, self.inputsize) TypeError: cannot unpack non-iterable NoneType object

HankYe commented 1 month ago

Hi, thanks for ur attention to our work. It seems that self.model.cuda().info(False, self.inputsize) return a Nonetype object. But from model_info() function, it should return a tuple. So I suggest you double-check the variable type of self.model.