当前位置:网站首页>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 边栏推荐
- QT with line encoding output cout
- 11 年膨胀 575 倍,微信为何从“小而美”变成了“大而肥”?
- How new people get started learning software testing
- 2022 Hangdian multi school field 2 1011 DOS card (line segment tree)
- [actual combat] realize page distortion correction with OpenCV
- Log base zap of go language series
- 真正的 HTAP 对用户和开发者意味着什么?
- MySQL date function
- Example of observer mode of C -- ordering milk
- LeetCode_ 1137_ Nth teponacci number
猜你喜欢

Use the self-developed proxy server to solve the cross domain access errors encountered when uploading files by SAP ui5 fileuploader trial version

Easynlp Chinese text and image generation model takes you to become an artist in seconds

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

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

Introduction and advanced MySQL (III)

我的创作纪念日 -- 2022年7月25日

Meta Q2 earnings: revenue fell for the first time, and metaverse will compete with apple

2022年中国企业服务产业市场行情

Redis cache avalanche, penetration, breakdown, bloom filter, detailed explanation of distributed lock

Structure and working principle of thyristor
随机推荐
How to adjust the brightness of win11? Four methods of adjusting screen brightness in win11
Zero knowledge proof: zkp with DDH assumption
历史上的今天:微软收购 QDOS;模型检测先驱出生;第一张激光照排的中文报纸...
Introduction and advanced MySQL (4)
1.1. Sparse array
真正的 HTAP 对用户和开发者意味着什么?
LeetCode_ 63_ Different paths II
Pyqt5 rapid development and practice 5.3 multithreading
GC garbage collector details
MYSQL入门与进阶(七)
EasyCVR接入设备后播放视频出现卡顿现象的原因分析及解决
全新升级!《云原生架构白皮书 2022 版》重磅发布
Introduction and advanced level of MySQL (II)
SwiftUI 组件之如何实现电话号码掩码隐藏部分的文本字段TextField(教程含源码)
2022杭电多校第二场1011 DOS Card(线段树)
N32替换STM32,这些细节别忽略!
How to use the white list function of the video fusion cloud service easycvr platform?
Is zero basic software testing training reliable?
[GXYCTF2019]StrongestMind
kotlin:Nothing