haodehao

Results 3 comments of haodehao

你好,我debug下来感觉不太对劲,模型是以网格左上角为anchor中心点计算的

我的yolov5成功了,你们出现的问题主要原因是out的grad_fn找不到,无法构建前后联系导致的剪枝失败,具体源码里的dependency.py 的506行

# 1、结果获取不到grad_fn # model = attempt_load(opt.weights, map_location='cpu').float().to(device) # 2、结构获取不到grad_fn # model = torch.load(opt.weights, map_location='cpu')['model'].float().eval().to(device) # 3、可以获取out的grad_fn ckpt = torch.load(opt.weights, map_location=device) model = Model('./models/yolov5s.yaml', ch=3, nc=1).to(device) state_dict = ckpt['model'].float().state_dict() state_dict =...