From 06242c200a318a37d1f882c786e60354ec04533f Mon Sep 17 00:00:00 2001 From: "Alexey U. Gudchenko" Date: Mon, 20 Jan 2020 22:50:57 +0300 Subject: [PATCH] Fix issue_703: backward compatibility with python3.6 (#715) --- 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 826329c803..3437ef3aa6 100644 --- a/pytorch_lightning/core/memory.py +++ b/pytorch_lightning/core/memory.py @@ -6,6 +6,7 @@ import gc import logging 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)]