YOLOv5-Multibackbone-Compression icon indicating copy to clipboard operation
YOLOv5-Multibackbone-Compression copied to clipboard

DEMO ERROR

Open mathpopo opened this issue 2 years ago ‱ 6 comments

hyperparameters: lr0=0.01, lrf=0.1, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0 TensorBoard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/ Weights & Biases: run 'pip install wandb' to automatically track and visualize YOLOv5 🚀 runs (RECOMMENDED) Downloading https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5n.pt to yolov5n.pt... 100%|██████████| 3.87M/3.87M [00:14<00:00, 290kB/s]

Overriding model.yaml nc=80 with nc=10

             from  n    params  module                                  arguments                     

0 -1 1 1760 models.common.Conv [3, 16, 6, 2, 2]
1 -1 1 4672 models.common.Conv [16, 32, 3, 2]
Traceback (most recent call last): File "/home/chenxin/disk1/github/YOLOv5-Multibackbone-Compression/train.py", line 678, in main(opt) File "/home/chenxin/disk1/github/YOLOv5-Multibackbone-Compression/train.py", line 575, in main train(opt.hyp, opt, device, callbacks) File "/home/chenxin/disk1/github/YOLOv5-Multibackbone-Compression/train.py", line 128, in train model = Model(cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create File "/home/chenxin/disk1/github/YOLOv5-Multibackbone-Compression/models/yolo_quantize.py", line 103, in init self.model, self.save = parse_model(deepcopy(self.yaml), ch=[ch]) # model, savelist File "/home/chenxin/disk1/github/YOLOv5-Multibackbone-Compression/models/yolo_quantize.py", line 288, in parse_model m_ = nn.Sequential(*[m(*args) for _ in range(n)]) if n > 1 else m(*args) # module File "/home/chenxin/disk1/github/YOLOv5-Multibackbone-Compression/models/common.py", line 477, in init self.cv1 = Conv(c1, c1_, 1, 1) File "/home/chenxin/disk1/github/YOLOv5-Multibackbone-Compression/models/common.py", line 349, in init self.conv = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=False) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 388, in init False, pair(0), groups, bias, padding_mode) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 112, in init self.reset_parameters() File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 115, in reset_parameters init.kaiming_uniform(self.weight, a=math.sqrt(5)) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/init.py", line 374, in kaiming_uniform_ fan = _calculate_correct_fan(tensor, mode) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/init.py", line 343, in _calculate_correct_fan fan_in, fan_out = _calculate_fan_in_and_fan_out(tensor) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/init.py", line 277, in _calculate_fan_in_and_fan_out receptive_field_size = tensor[0][0].numel() IndexError: index 0 is out of bounds for dimension 0 with size 0

mathpopo avatar Apr 01 '22 09:04 mathpopo

https://github.com/Gumpest/YOLOv5-Multibackbone-Compression/issues/19 But i download last week

mathpopo avatar Apr 01 '22 09:04 mathpopo

git clone https://github.com/ZLkanyo009/MQBench.git cd MQBench python setup.py build python setup.py install

i install MQBench0.02

mathpopo avatar Apr 01 '22 09:04 mathpopo

Parameter containing: tensor([], size=(0, 32, 1, 1), requires_grad=True)

mathpopo avatar Apr 01 '22 09:04 mathpopo

def __init__(self, c1, c2, c2o, n=1, shortcut=True, g=1, e=[0.5,0.5], rate=[1.0 for _ in range(12)]):  # ch_in, ch_out, number, shortcut, groups, expansion 
    super().__init__()
    # c_ = int(c2 * e)  # hidden channels
    if isinstance(e,list):
        c1_ = int(c2o * e[0])---int(0.5)->0
        c2_ = int(c2o * e[1])
    else:
        c1_ = int(c2o * e)
        c2_ = int(c2o * e)

mathpopo avatar Apr 01 '22 09:04 mathpopo

/YOLOv5-Multibackbone-Compression/models/common.py

mathpopo avatar Apr 01 '22 09:04 mathpopo

æ‚šć„œ è§Łć†łäș†ć˜›ïŒŸæˆ‘é‡ćˆ°äș†ćŒæ ·çš„é—źéą˜

JiewenZhao avatar Mar 15 '23 12:03 JiewenZhao