当前位置:网站首页>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 ])
边栏推荐
- Exploration and practice of "flow batch integration" in JD
- 图灵奖得主LeCun指明AI未来的出路在于自主学习,这家公司已踏上征途
- Microbiological health, why is food microbiological testing important
- Unknown database connection database error
- 【动态规划】路径dp:931. Minimum Falling Path Sum
- User defined annotation implementation verification
- New opportunities for vr/ar brought by metauniverse
- Service grid ASM year end summary: how do end users use the service grid?
- Koa koa combine routes sub route management
- dc_ Study and summary of labs--lab1
猜你喜欢

工作6年,来盘点一下职场人混迹职场的黄金法则

dc_labs--lab1的学习与总结

DC学习笔记正式篇之零——综述与基本流程介绍

流批一体在京东的探索与实践

WIN11中MathType编辑中“打开数学输入面板”是灰色不可编辑

图灵奖得主LeCun指明AI未来的出路在于自主学习,这家公司已踏上征途

Introduction and principle analysis of cluster and LVS

3dsmax plug-in development traversal node object and object acquisition and inode transformation matrix description

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

个人博客搭建与美化
随机推荐
Open3D 点云颜色渲染
图的连通性基础
[dynamic planning] path dp:931 Minimum Falling Path Sum
1500w播放下还藏着什么热点?B站2个未来趋势你不得错过
【Qt5-基础篇】随机数显示屏展示
面对产业互联网的时候,甚至还用消费互联网的方式和方法去落地和实践产业互联网
uniapp官方组件点击item无效,解决方案
Basic knowledge II - Basic definitions related to sta
The liquor and tourism sector recovers, and Yaduo continues to dream of listing. How far is it from "the first share of the new accommodation economy"?
微生物健康,食品微生物检测为什么很重要
About the general input operation mode of unity
[leetcode] climb stairs [70]
直播商城源码,实现左右联动商品分类页面
Call the classic architecture and build the model based on the classic
About vctk datasets
Pre training / transfer learning of models
Strictmode analysis registration strictmode principle (4)
Thinking brought by strictmode -strictmode principle (5)
Using recyclerreview to show banner is very simple
用recyclerReview展示Banner,很简单