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')

相关推荐
GeeLark2 分钟前
GeeLark 9月功能更新回顾
人工智能
mwq3012315 分钟前
GPT-2 中的 Pre-Layer Normalization (Pre-LN) 架构详解
人工智能
智奇数美20 分钟前
“成本减法”与“效率乘法”——AI智能重构企业通信格局
人工智能·智能手机·信息与通信
技术闲聊DD28 分钟前
机器学习(1)- 机器学习简介
人工智能·机器学习
mwq3012334 分钟前
GPT-2 中的残差权重初始化
人工智能
mwq301231 小时前
Transformer : 深度神经网络中的残差连接 (Residual Connection)
人工智能
信田君95271 小时前
瑞莎星瑞(Radxa Orion O6) 基于 Android OS 使用 NPU的图片模糊查找APP 开发
android·人工智能·深度学习·神经网络
StarPrayers.1 小时前
卷积神经网络(CNN)入门实践及Sequential 容器封装
人工智能·pytorch·神经网络·cnn
周末程序猿1 小时前
谈谈上下文工程(Context Engineering)
人工智能