Skip to content

Commit 06242c2

Browse files
goodokwilliamFalcon
authored andcommitted
Fix issue_703: backward compatibility with python3.6 (#715)
1 parent ea59a99 commit 06242c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pytorch_lightning/core/memory.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import logging
77
import os
88
import subprocess
9+
from subprocess import PIPE
910

1011
import numpy as np
1112
import pandas as pd
@@ -235,7 +236,8 @@ def get_gpu_memory_map():
235236
'--format=csv,nounits,noheader',
236237
],
237238
encoding='utf-8',
238-
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
239241
check=True)
240242
# Convert lines into a dictionary
241243
gpu_memory = [int(x) for x in result.stdout.strip().split(os.linesep)]

0 commit comments

Comments
 (0)