Skip to content

Commit

Permalink
Fix issue_703: backward compatibility with python3.6 (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
goodok authored and williamFalcon committed Jan 20, 2020
1 parent ea59a99 commit 06242c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytorch_lightning/core/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import os
import subprocess
from subprocess import PIPE

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -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)]
Expand Down

0 comments on commit 06242c2

Please sign in to comment.