learning/Python

[Python] GPU 제한

유자유자 2022. 4. 15. 11:58

[ TF ]

gpu 제한 명령어

gpu = tf.config.experimental.list_physical_devices('GPU')
if gpu:
    tf.config.experimental.set_virtual_device_configuration(gpu[0], [tf.config.experimental.VirtualDeviceConfiguration(memory_limit = 7 * 1024)])