使用GPU训练模型中出现的问题记录
查看GPU状态
1 | # cmd |
内存溢出
pycharm报错:
1 | tensorflow.python.framework.errors_impl.InternalError: Blas xGEMM launch failed : a.shape=[1,1,100], b.shape=[1,100,12544], m=1, n=12544, k=100 [Op:MatMul] |
原因是内存溢出
参考stackoverflow,增加两行代码后解决
1 | physical_devices = tf.config.list_physical_devices('GPU') |
设置使用量(暂时没起到作用)
1 | gpus = tf.config.experimental.list_physical_devices(device_type='GPU') |