We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea59a99 commit 06242c2Copy full SHA for 06242c2
pytorch_lightning/core/memory.py
@@ -6,6 +6,7 @@
6
import logging
7
import os
8
import subprocess
9
+from subprocess import PIPE
10
11
import numpy as np
12
import pandas as pd
@@ -235,7 +236,8 @@ def get_gpu_memory_map():
235
236
'--format=csv,nounits,noheader',
237
],
238
encoding='utf-8',
- capture_output=True,
239
+ # capture_output=True, # valid for python version >=3.7
240
+ stdout=PIPE, stderr=PIPE, # for backward compatibility with python version 3.6
241
check=True)
242
# Convert lines into a dictionary
243
gpu_memory = [int(x) for x in result.stdout.strip().split(os.linesep)]
0 commit comments