在AN中执行期间选择GPU

2024-10-01 22:42:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我在一台4gpu的机器上用土豆和千层面训练神经网络。My.theanorc包含以下行:

[global]
device = gpu0

所以当在python中执行import theano时,我得到Using gpu device 0: GRID K520

如果在导入theano之后,我选择使用say gpu1呢?我想动态地这样做,也就是说,不需要编辑.theanorc这可能吗?甚至在运行时选择它?


Tags: import机器gpumydevice神经网络theanoglobal

热门问题