PAGCP icon indicating copy to clipboard operation
PAGCP copied to clipboard

TypeError: cannot unpack non-iterable NoneType object

Open 7W7W7W opened this issue 1 year ago • 1 comments

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

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 sen_dict = 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

7W7W7W avatar Jul 24 '24 08:07 7W7W7W

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.

HankYe avatar Jul 24 '24 09:07 HankYe