当前位置: 首页 > news >正文

网站建设公司电话销售客源哪里找免费表白网站制作

网站建设公司电话销售客源哪里找,免费表白网站制作,电脑接单做任务平台,企业网站新闻如何建设续yolov7改进优化之蒸馏#xff08;一#xff09;-CSDN博客 上一篇已经基本写出来yolov7/v5蒸馏的整个过程#xff0c;不过要真的训起来我们还需要进行一些修改。 Model修改 蒸馏需要对teacher和student网络的特征层进行loss计算#xff0c;因此我们forward时要能够返回需…续yolov7改进优化之蒸馏一-CSDN博客 上一篇已经基本写出来yolov7/v5蒸馏的整个过程不过要真的训起来我们还需要进行一些修改。 Model修改 蒸馏需要对teacher和student网络的特征层进行loss计算因此我们forward时要能够返回需要的中间层这需要修改yolo.py中的Model类。 forward_once接口修改 增加接口参数 extra_features用于指定要返回的中间层的索引: def forward_once(self, x, profileFalse, extra_features: list []):y, dt [], [] # outputsfeatures []for i, m in enumerate(self.model):if m.f ! -1: # if not from previous layerx y[m.f] if isinstance(m.f, int) else [x if j -1 else y[j] for j in m.f] # from earlier layersif not hasattr(self, traced):self.traced Falseif self.traced:if (isinstance(m, Detect)or isinstance(m, IDetect)or isinstance(m, IAuxDetect)or isinstance(m, IKeypoint)):breakif profile:c isinstance(m, (Detect, IDetect, IAuxDetect, IBin))o thop.profile(m, inputs(x.copy() if c else x,), verboseFalse)[0] / 1e9 * 2 if thop else 0 # FLOPSfor _ in range(10):m(x.copy() if c else x)t time_synchronized()for _ in range(10):m(x.copy() if c else x)dt.append((time_synchronized() - t) * 100)print(%10.1f%10.0f%10.1fms %-40s % (o, m.np, dt[-1], m.type))x m(x) # runy.append(x if m.i in self.save else None) # save outputif i in extra_features:features.append(x)if not self.training and len(extra_features) ! 0 and len(extra_features) len(features):return x, featuresif profile:print(%.1fms total % sum(dt))if len(extra_features) ! 0:return x, featuresif self.training and isinstance(x, tuple):x x[-1]return x主要增加将中间层返回的代码。 forward接口修改 forward接口调用了forward_once接口因此forward接口也需要增加这个参数。 def forward(self, x, augmentFalse, profileFalse, extra_features: list []):if augment:img_size x.shape[-2:] # height, widths [1, 0.83, 0.67] # scalesf [None, 3, None] # flips (2-ud, 3-lr)y [] # outputsfor si, fi in zip(s, f):xi scale_img(x.flip(fi) if fi else x, si, gsint(self.stride.max()))yi self.forward_once(xi)[0] # forward# cv2.imwrite(fimg_{si}.jpg, 255 * xi[0].cpu().numpy().transpose((1, 2, 0))[:, :, ::-1]) # saveyi[..., :4] / si # de-scaleif fi 2:yi[..., 1] img_size[0] - yi[..., 1] # de-flip udelif fi 3:yi[..., 0] img_size[1] - yi[..., 0] # de-flip lry.append(yi)return torch.cat(y, 1), None # augmented inference, trainelse:return self.forward_once(x, profile, extra_features) # single-scale inference, trainhyp文件修改 在hyp文件中添加student_kd_layers和teacher_kd_layers来指定要蒸馏的层我们可以指定IDetect前面的三个特征层 student_kd_layers: [75,88,101] teacher_kd_layers: [75,88,101]训练 训练方式与正常训练一样只是启动时要指定teacher-weights。 结语 这一篇结合上一篇就可以吧基于FGD算法的蒸馏训练起来了其他蒸馏的修改也大同小异了。
http://www.hkea.cn/news/14485251/

相关文章:

  • 深圳设计网站排行网站关键词快速排名工具
  • 免费建立个人网站凡科兰州网站制作怎么样
  • icp备案网站接入信息怎么填wordpress 仿煎蛋妹子图
  • 编程做网站容易还是做软件网页设计公司logo放哪个位置
  • 公司部门网站设计模板wordpress案例讲解
  • 郑州郑东新区网站建设做购物平台网站 民治
  • 换空间网站备案室内设计网站界面
  • 网页设计与网站建设作品怎么做个人网页
  • 个人网站有哪些站网站建设公司怎
  • 网站建设 收费明细成立一个网站软件需要多少钱
  • 网站如何做seo的淘宝网站的建设
  • 百度网站推广咨询网络信息安全工程师
  • 国外设计素材网站wordpress 文件上传插件
  • 河南建一个网站大概要多少钱如何做百度网站2017
  • 学做网站能赚多少钱做网站公司北京
  • 郑州做网站多少钱培训教育类网站模板下载
  • 汽车贸易网站建设方案技术支持 上海做网站
  • 网站怎么做直播功能沧州网站建设定制价格
  • 竹子建站公司手机网站开发一个多少钱
  • 网站怎么上传网站吗php网站开发工程师岗位职责
  • 一个网站做多有几种颜色网站后台域名登陆软件
  • 深圳公司做网站wordpress嵌套海洋cms
  • 做什么网站最赚钱免费建网页
  • wordpress建立的网站吗佛山网站建设公司哪家便宜
  • 邢台网站建设公司中企动力网站建设合同
  • 用jsp做留言板网站网页颜色搭配案例
  • 军队工程建设项目招投标网站网络事件营销
  • 免费行情网站app页面wordpress插件 二次开放
  • 汨罗网站建设盐城网站开发基本流程
  • 沈阳哪里有教做网站的wordpress 头像加速