Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEMO ERROR #71

Open
mathpopo opened this issue Apr 1, 2022 · 6 comments
Open

DEMO ERROR #71

mathpopo opened this issue Apr 1, 2022 · 6 comments
Assignees

Comments

@mathpopo
Copy link

mathpopo commented Apr 1, 2022

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
Copy link
Author

mathpopo commented Apr 1, 2022

#19 But i download last week

@mathpopo
Copy link
Author

mathpopo commented Apr 1, 2022

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

i install MQBench0.02

@mathpopo
Copy link
Author

mathpopo commented Apr 1, 2022

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

@mathpopo
Copy link
Author

mathpopo commented Apr 1, 2022

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
Copy link
Author

mathpopo commented Apr 1, 2022

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

@JiewenZhao
Copy link

您好 解决了嘛?我遇到了同样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants