当前位置:网站首页>TypeError: can‘t convert cuda:0 device type tensor to numpy. Use Tensor. cpu() to copy the tensor to
TypeError: can‘t convert cuda:0 device type tensor to numpy. Use Tensor. cpu() to copy the tensor to
2022-07-01 01:33:00 【AI Hao】
Problem description :
Traceback (most recent call last):
File "D:\rotation-yolov5-master\detect.py", line 173, in <module>
detect()
File "D:\rotation-yolov5-master\detect.py", line 114, in detect
plot_one_box(xywh, im0, label=label, color=colors[int(cls)], line_thickness=3, path=path)
File "D:\rotation-yolov5-master\utils\general.py", line 1316, in plot_one_box
x = np.array(x)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\_tensor.py", line 678, in __array__
return self.numpy()
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
Change it to :
x = np.array([i.data.item() for i in x ])
边栏推荐
- Parity linked list [two general directions of linked list operation]
- Neo4j installation, operation, project construction and function realization
- [deepin] common sets
- qt5-MVC:数据可视化的层次揭秘
- Construction and beautification of personal blog
- One of the basics - overview of sta Basics
- Unknown database连接数据库错误
- Why build a personal blog
- Note d'étude du DC: zéro dans le chapitre officiel - - Aperçu et introduction du processus de base
- 图的连通性基础
猜你喜欢
![Split the linked list [take next first and then cut the linked list to prevent chain breakage]](/img/eb/708ab20c13df75f4dbd2d6461d3602.png)
Split the linked list [take next first and then cut the linked list to prevent chain breakage]

Introduction and principle analysis of cluster and LVS

Pre training / transfer learning of models

Note d'étude du DC: zéro dans le chapitre officiel - - Aperçu et introduction du processus de base

dc_ Study and summary of labs--lab1

那些一门心思研究自动化测试的人,后来怎样了?

gin_ gorm

Zero of DC learning notes -- overview and basic process introduction
![[问题已处理]-nvidia-smi命令获取不到自身容器的GPU进程和外部的GPU进程号](/img/51/e48e222c14f4a4e9f2be91a677033f.png)
[问题已处理]-nvidia-smi命令获取不到自身容器的GPU进程和外部的GPU进程号

用recyclerReview展示Banner,很简单
随机推荐
基础知识之一——STA基础概述
【栈】921. Minimum Add to Make Parentheses Valid
About vctk datasets
Open3D 点云颜色渲染
Service grid ASM year end summary: how do end users use the service grid?
neo4j安装、运行以及项目的构建和功能实现
Construction and beautification of personal blog
Digital IC design process summary
【office办公-pdf篇】pdf合并与拆分让我们摆脱付费软件的功能限制好不好
Split the linked list [take next first and then cut the linked list to prevent chain breakage]
迪赛智慧数——其他图表(平行坐标图):2021年应届专业就业情况
"Open math input panel" in MathType editing in win11 is gray and cannot be edited
Pre training / transfer learning of models
Basic knowledge II - Basic definitions related to sta
Thinking brought by strictmode -strictmode principle (5)
Installing mongodb database in Windows Environment
尝试新的可能
uniapp官方组件点击item无效,解决方案
What are the functions of soil microorganisms in microbial detection?
Koa koa combine routes sub route management