当前位置:网站首页>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 ])
边栏推荐
猜你喜欢

2021电赛F题openmv和K210调用openmv api巡线,完全开源。

Packing and unpacking of C #

二十多年来第一次!CVPR最佳学生论文授予中国高校学生!

人穷志不短,穷学生也能玩转树莓派

Service grid ASM year end summary: how do end users use the service grid?

双位置继电器DLS-5/2 DC220V

【学习笔记】倍增 + 二分

How to do the performance pressure test of "Health Code"

Install redis database and download redis Desktop Manager in win11

Metauniverse and virtual reality (II)
随机推荐
機器人編程的培訓學科類原理
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"?
[LeetCode] 爬楼梯【70】
New content violation degree determination scana bad information monitoring capability update issue 5
【学习笔记】简单dp
For the first time in more than 20 years! CVPR best student thesis awarded to Chinese college students!
fluttertoast
Green, green the reed. dew and frost gleam.
uniapp官方组件点击item无效,解决方案
Vnctf 2022 cm CM1 re reproduction
[learning notes] double + two points
解决IDEA:Class ‘XXX‘ not found in module ‘XXX‘
ESP8266 RC522
K210 site helmet
Q弹松软的大号吐司,带来更舒服的睡眠
Split the linked list [take next first and then cut the linked list to prevent chain breakage]
How to do the performance pressure test of "Health Code"
软件开发完整流程
06.论Redis持久化的几种方式
StrictMode分析Activity泄漏-StrictMode原理(3)