当前位置:网站首页>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 ])
边栏推荐
- Koa koa combine routes sub route management
- MFC TCP communication server client demo notes vs2019
- [dynamic planning] path dp:931 Minimum Falling Path Sum
- uniapp官方组件点击item无效,解决方案
- 用 Flutter 的 Canvas 画点有趣的图形
- K210 site helmet
- "Open math input panel" in MathType editing in win11 is gray and cannot be edited
- Service grid ASM year end summary: how do end users use the service grid?
- ASCII、Unicode、GBK、UTF-8之间的关系
- 软件开发完整流程
猜你喜欢

flutter报错 -- The argument type ‘Function‘ can‘t be assigned to the parameter type ‘void Function()?‘

Use of typora

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

基础知识之二——STA相关的基本定义

dc_labs--lab1的学习与总结

Opencv basic operation 2 realizes label2rgb and converts gray-scale images into color images

亲测有效,快速创建JMeter桌面快捷方式

What will Web3 bring in the future?

Installing mongodb database in Windows Environment

3dsmax插件开发遍历节点对象和Object获取及INode变换矩阵说明
随机推荐
用 Flutter 的 Canvas 画点有趣的图形
neo4j安装、运行以及项目的构建和功能实现
sort自定义函数
MATLAB 最远点采样(FPS改进版)
Why not two or four TCP handshakes
C# 自定义并动态切换光标
【模拟】922. Sort Array By Parity II
Basic knowledge of software and hardware -- diary (1)
Solve idea:class' xxx 'not found in module' xxx‘
[simulation] 922 Sort Array By Parity II
Installing mongodb database in Windows Environment
3dsmax插件开发遍历节点对象和Object获取及INode变换矩阵说明
基础知识之二——STA相关的基本定义
Service grid ASM year end summary: how do end users use the service grid?
友盟(软件异常实时监听的好帮手:Crash)接入教程(有点基础的小白最易学的教程)
未来的 Web3会带来什么?
Install redis database and download redis Desktop Manager in win11
物业怎么发短信通知给业主?
Open3D 点云颜色渲染
TypeError: can‘t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to