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

K210 site helmet

Shift operators

PHP online confusion encryption tutorial sharing + basically no solution

Looksrare team's "cash out" caused disturbance

Kongyiji's first question: how much do you know about service communication?

【go】go 实现行专列 将集合进行转列

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

Double position relay dls-5/2 dc220v

Training discipline principle of robot programming

DLS-42/6-4 DC110V双位置继电器
随机推荐
Service grid ASM year end summary: how do end users use the service grid?
Basic knowledge of software and hardware -- diary (1)
Web compatibility testing of software testing
StrictMode带来的思考-StrictMode原理(5)
Is the public read-only field with immutable structure valid- Does using public readonly fields for immutable structs work?
Poor students can also play raspberry pie
孔乙己第一问之服务通信知多少?
Vnctf 2022 cm CM1 re reproduction
About the general input operation mode of unity
ESP8266 RC522
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"?
ORB-SLAM2源码学习(二)地图初始化
Dls-42/6-4 dc110v double position relay
Exercises on recursion in C language
How to do the performance pressure test of "Health Code"
数字IC设计流程总结
机器人编程的培训学科类原理
DC學習筆記正式篇之零——綜述與基本流程介紹
Windows环境下安装MongoDB数据库
双位置继电器ST2-2L/AC220V