From 62d917f5f2407b49db1291835436ab35d79ba3d9 Mon Sep 17 00:00:00 2001 From: "Alexey U. Gudchenko" Date: Mon, 20 Jan 2020 15:05:46 +0300 Subject: [PATCH] Fix issue_703: backward compatibility with python3.6 --- pytorch_lightning/core/memory.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/core/memory.py b/pytorch_lightning/core/memory.py index 1abc349e1ef21..b6c2dcdb07064 100644 --- a/pytorch_lightning/core/memory.py +++ b/pytorch_lightning/core/memory.py @@ -5,6 +5,7 @@ import gc import os import subprocess +from subprocess import PIPE import numpy as np import pandas as pd @@ -235,7 +236,8 @@ def get_gpu_memory_map(): '--format=csv,nounits,noheader', ], encoding='utf-8', - capture_output=True, + # capture_output=True, # valid for python version >=3.7 + stdout=PIPE, stderr=PIPE, # for backward compatibility with python version 3.6 check=True) # Convert lines into a dictionary gpu_memory = [int(x) for x in result.stdout.strip().split(os.linesep)]