Torch-Pruning icon indicating copy to clipboard operation
Torch-Pruning copied to clipboard

expected input[22, 77, 80, 80] to have 128 channels, but got 77 channels instead

Open bryanbocao opened this issue 3 years ago • 1 comments

Got

RuntimeError: Given groups=1, weight of size [255, 128, 1, 1], expected input[22, 77, 80, 80] to have 128 channels, but got 77 channels instead

when running

python train_with_pruning.py --data coco.yaml --cfg yolov5s.yaml --weights '' --batch-size 64

based on https://github.com/VainF/Torch-Pruning/tree/master/examples/coco_yolo.

bryanbocao avatar Jul 21 '22 03:07 bryanbocao

I also had the same problem,when running

python train_with_pruning.py --data coco128.yaml --cfg yolov5s.yaml --weights '' --batch-size 64

RuntimeError: Given groups=1, weight of size [255, 128, 1, 1], expected input[8, 77, 80, 80] to have 128 channels, but got 77 channels instead @VainF could you help resolve this problem?

naivewx avatar Aug 01 '22 04:08 naivewx

I also had the same problem,when running

python train_with_pruning.py --data coco128.yaml --cfg yolov5s.yaml --weights '' --batch-size 64

RuntimeError: Given groups=1, weight of size [255, 128, 1, 1], expected input[8, 77, 80, 80] to have 128 channels, but got 77 channels instead @VainF could you help resolve this problem?

Installing torch-pruning with the version of 0.2.5 solves this problem.

YouAndMe8342 avatar Oct 07 '22 09:10 YouAndMe8342