当前位置:网站首页>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 ])
边栏推荐
- Sun Yuchen told Swiss media Bilan that the bear market will not last long
- 3dsmax插件开发遍历节点对象和Object获取及INode变换矩阵说明
- [问题已处理]-nvidia-smi命令获取不到自身容器的GPU进程和外部的GPU进程号
- What are the functions of soil microorganisms in microbial detection?
- 微生物健康,食品微生物检测为什么很重要
- Introduction and principle analysis of cluster and LVS
- [leetcode] sum of two numbers [1]
- 微研所,微生物检验中常用的生化反应
- 孙宇晨接受瑞士媒体Bilan采访:熊市不会持续太久
- 基础知识之一——STA基础概述
猜你喜欢
Creating ASCII art with C #
qt5-MVC:数据可视化的层次揭秘
Introduction and principle analysis of cluster and LVS
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"?
What will Web3 bring in the future?
Uniapp official component clicking item is invalid, solution
Installing mongodb database in Windows Environment
Green, green the reed. dew and frost gleam.
QT5-布局在创作中的理解应用
【Qt5-基础篇】随机数显示屏展示
随机推荐
Qt5 mvc: revealing the secrets of data visualization
孙宇晨接受瑞士媒体Bilan采访:熊市不会持续太久
[Deepin] 常用集合
Pre training / transfer learning of models
【qt5-tab标签精讲】Tab标签及内容分层解析
Split the linked list [take next first and then cut the linked list to prevent chain breakage]
Koa koa combine routes sub route management
WIN11中MathType编辑中“打开数学输入面板”是灰色不可编辑
Docker deployment MySQL 8
Log logrus third party library usage
微生物健康,食品微生物检测为什么很重要
None of the following candidates is applicable because of a receiver type mismatch
MFC TCP通信服务端客户端Demo备忘vs2019
医疗HIS行业短信发送解决方案
QT5-布局在创作中的理解应用
短信在企业中的应用有哪些?
Microbial safety and health, what is biological treatment?
物业怎么发短信通知给业主?
45岁程序员告诉你:程序员为什么要跳槽,太真实...
gin_gorm