pytorch中数据和模型都要部署在cuda上面

注意一定要两个都部署在模型训练之前,缺少一个都会报错在两个设备上训练,一个在cpu,一个在cuda

部署数据到cuda上

复制代码
point_features = torch.tensor(point_features, dtype=torch.float32).to('cuda')  # 如果你有支持的 GPU,shape = (499,3159,3)
coord_time = torch.tensor(coord_time, dtype=torch.float32).to('cuda')  # 如果你有支持的 GPU  shape = (3159,3)
target = torch.tensor(target, dtype=torch.float32).to('cuda')  # 如果你有支持的 GPU  shape = (499,3159,3)

部署模型到cuda上

model = model.to('cuda')

相关推荐
Henry-SAP2 小时前
SAP引领ERP智能化转型
人工智能·云原生·sap·erp
峥嵘life2 小时前
Android16 311Y3 EAP-TLS 网络连接失败分析与修复总结
android·开发语言·人工智能·php
特立独行的猫a2 小时前
一切皆插件:DeepSeek Harness 的架构哲学,以及与主流 Agent 的对比
人工智能·架构·agent·deepseek·harness
电商API_180079052473 小时前
京东商品详情API技术文章
大数据·运维·人工智能·网络爬虫
fīɡЙtīиɡ ℡3 小时前
AI Agent 记忆系统
人工智能
企鹅的企4 小时前
2027北京AI数字健康与智慧医疗展官方:超两成展品亚洲首秀
人工智能·科技·机器人
lvts_cs4 小时前
淄博高新区绿天使数智创新港:高标准产研厂房全维度详解
大数据·人工智能
百胜软件@百胜软件4 小时前
从“人找货”到“货找人”:「胜券商品」如何用AI重构配补调
人工智能·重构
风流 少年4 小时前
Spring AI 2.0:Advisor
android·人工智能·spring