diff --git a/pydiffvg_tensorflow/render_tensorflow.py b/pydiffvg_tensorflow/render_tensorflow.py index 6a7875b..eed7e28 100644 --- a/pydiffvg_tensorflow/render_tensorflow.py +++ b/pydiffvg_tensorflow/render_tensorflow.py @@ -1,3 +1,4 @@ +import os import tensorflow as tf import diffvg import pydiffvg_tensorflow as pydiffvg @@ -457,7 +458,7 @@ def render(*x): The main TensorFlow interface of C++ diffvg. """ assert(tf.executing_eagerly()) - if pydiffvg.get_use_gpu() and os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] != 'true': + if pydiffvg.get_use_gpu() and os.environ.get('TF_FORCE_GPU_ALLOW_GROWTH') != 'true': print('******************** WARNING ********************') print('Tensorflow by default allocates all GPU memory,') print('causing huge amount of page faults when rendering.')