当前位置:网站首页>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 00:41:00 【AI浩】
问题描述:
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.
改为:
x = np.array([i.data.item() for i in x ])
边栏推荐
- pull_ to_ refresh
- 解决IDEA:Class ‘XXX‘ not found in module ‘XXX‘
- Hoo research | coinwave production - nym: building the next generation privacy infrastructure
- C语言一点点(未来可会增加)
- Fluent JSON serialization deserialization
- K210 access control complete
- Dx-11q signal relay
- Win11安装redis 数据库以及redis desktop manager的下载
- Dls-42/6-4 dc110v double position relay
- Installing mongodb database in Windows Environment
猜你喜欢

DC學習筆記正式篇之零——綜述與基本流程介紹

Installing mongodb database in Windows Environment

Analyze the maker education path integrating the essence of discipline

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

软件开发完整流程

Xjy-220/43ac220v static signal relay

软硬件基础知识学习--小日记(1)

uniapp官方组件点击item无效,解决方案

Green, green the reed. dew and frost gleam.

DLS-42/6-4 DC110V双位置继电器
随机推荐
小程序自定义宫格
Dls-20 double position relay 220VDC
Detailed analysis of operators i++ and ++i in JS, i++ and ++i
Installing mongodb database in Windows Environment
解析创客教育实践中的智慧原理
Document service design
Koa koa combine routes sub route management
Two position relay st2-2l/ac220v
Mustache syntax
Chromatic judgement bipartite graph
Shift operators
基础知识之三——标准单元库
双位置继电器ST2-2L/AC220V
Exploring the road of steam education innovation in the Internet Era
MFC TCP通信服务端客户端Demo备忘vs2019
MATLAB 最远点采样(FPS改进版)
冲击继电器ZC-23/DC220V
K210工地安全帽
ORB-SLAM2源码学习(二)地图初始化
文件服务设计