当前位置:网站首页>Pytorch GPU yolov5 reports an error
Pytorch GPU yolov5 reports an error
2022-07-28 18:59:00 【code bean】
A wrong :
AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'
resolvent , modify pytorch Source code :
Lib\site-packages\torch\nn\modules Next, find the file upsampling.py

def forward(self, input: Tensor) -> Tensor:
# return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,
# recompute_scale_factor=self.recompute_scale_factor)
return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners)Error 2 :
RuntimeError: result type Float can't be cast to the desired output type xxx
yolov5 Under the 【utils Folder 】 Medium 【loss.py】
Two points to be modified ( Annotated code is the previous code , The following is modified ):

The two revised categories are as follows :
anchors, shape = self.anchors[i], p[i].shape # modify ,2022 year 7 month 11 Japan
indices.append((b, a, gj.clamp_(0, shape[2] - 1), gi.clamp_(0, shape[3] - 1))) # image, anchor, grid # modify ,2022 year 7 month 11 Japan 边栏推荐
- Is it easy to learn the zero foundation of software testing?
- Getting started with gateway
- Can zero basis software testing work?
- 数字经济时代的开源数据库创新 | 2022开放原子全球开源峰会数据库分论坛圆满召开
- New progress in the implementation of the industry | the openatom openharmony sub forum of the 2022 open atom global open source summit was successfully held
- 什么样的知识付费系统功能,更有利于平台与讲师发展?
- Differences between RDB and AOF for redis persistence
- Structure and working principle of thyristor
- Today in history: Microsoft acquires qdos; Model testing pioneer birth; The first laser typesetting Chinese newspaper
- @The difference between Autowired and @resource
猜你喜欢

Introduction and advanced level of MySQL (I)

APP为什么用JSON协议与服务端交互:序列化相关知识

New progress in the implementation of the industry | the openatom openharmony sub forum of the 2022 open atom global open source summit was successfully held

jvm四种引用类型

数字经济时代的开源数据库创新 | 2022开放原子全球开源峰会数据库分论坛圆满召开

kotlin:Nothing

Introduction and advanced MySQL (7)

GC垃圾回收器详解

How to solve the problem that the win11 computer camera cannot be seen when it is turned on and the display screen is black?

零知识证明:具有DDH假设的 ZKP
随机推荐
kotlin:Nothing
Decimal to binary advanced version (can convert negative numbers and boundary values)
One Hot编码是什么?为什么要用它,什么时候用它?
Overview and working principle of single chip microcomputer crystal oscillator
Structure and working principle of thyristor
Zero knowledge proof: zkp with DDH assumption
[GXYCTF2019]StrongestMind
Swiftui component how to implement textfield of hidden part of phone number mask (tutorial includes source code)
kotlin:Nothing
How to obtain data on mobile phones and web pages after the SCM data is uploaded to Alibaba cloud Internet of things platform?
How to use the white list function of the video fusion cloud service easycvr platform?
2022年牛客多校第2场 J . Link with Arithmetic Progression (三分+枚举)
The login interface of modern personal blog system modstartblog v5.4.0 has been revised and the contact information has been added
When the new version of easycvr is linked at the same level, the subordinate platform passes up the cause analysis of the incomplete display of the hierarchical directory
AI 改变千行万业,开发者如何投身 AI 语音新“声”态
Is the prospect of software testing dead? Has it entered the cold winter?
If you want to change to it, does it really matter if you don't have a major?
MYSQL入门与进阶(二)
Introduction and advanced level of MySQL (5)
Configuration tutorial: how does the organizational structure of the new version of easycvr (v2.5.0) cascade to the superior platform?