稳定基线 - model.predict:如何选择 GPU

问题描述 投票:0回答:1

我正在使用 Stable-Baselines3,我想测试我刚刚训练的模型。

如何分配特定的 GPU 来执行

model.predict
方法?

reinforcement-learning stable-baselines
1个回答
0
投票

创建模型时需要将设备分配给模型,然后

predict
会自动使用所选的设备。

例如

model = DQN(..., device='cuda:0', ...)
model.predict(...)    # this would use the cuda:0 device
© www.soinside.com 2019 - 2024. All rights reserved.