当前位置:网站首页>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 ])
边栏推荐
- (学习力+思考力) x 行动力,技术人成长的飞轮效应总结
- Analyze the maker education path integrating the essence of discipline
- 集群与LVS介绍及原理解析
- Open3D 点云颜色渲染
- Exercises on recursion in C language
- For the first time in more than 20 years! CVPR best student thesis awarded to Chinese college students!
- StrictMode分析Registion-StrictMode原理(4)
- StrictMode卡顿与泄漏检测-StrictMode原理(2)
- 【网络丢包,网络延迟?这款神器帮你搞定所有!】
- K210 site helmet
猜你喜欢
随机推荐
Hoo research | coinwave production - nym: building the next generation privacy infrastructure
Dls-42/6-4 dc110v double position relay
[go] go implements row column conversion of sets
Flutter Error: Cannot run with sound null safety, because the following dependencies don‘t support
Install redis database and download redis Desktop Manager in win11
Packing and unpacking of C #
Poor students can also play raspberry pie
文件服务设计
Metauniverse and virtual reality (II)
Vnctf 2022 cm CM1 re reproduction
探索互联网时代STEAM教育创新之路
None of the following candidates is applicable because of a receiver type mismatch
C语言一点点(未来可会增加)
Call the classic architecture and build the model based on the classic
Green, green the reed. dew and frost gleam.
PHP online confusion encryption tutorial sharing + basically no solution
人穷志不短,穷学生也能玩转树莓派
ESP8266 RC522
[Deepin] 常用集合
冲击继电器ZC-23/DC220V