From b38888f88ce8b45680f8cedcc4b0cef137156561 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Sun, 2 Apr 2017 09:24:01 +0800 Subject: [PATCH] add comment for DISABLE_PLOT --- python/paddle/v2/plot/plot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/paddle/v2/plot/plot.py b/python/paddle/v2/plot/plot.py index a685036970..6f7bd039b0 100644 --- a/python/paddle/v2/plot/plot.py +++ b/python/paddle/v2/plot/plot.py @@ -35,6 +35,10 @@ class Ploter(object): self.__plot_data__ = {} for title in args: self.__plot_data__[title] = PlotData() + # demo in notebooks will use Ploter to plot figure, but when we convert + # the ipydb to py file for testing, the import of matplotlib will make the + # script crash. So we can use `export DISABLE_PLOT=True` to disable import + # these libs self.__disable_plot__ = os.environ.get("DISABLE_PLOT") if not self.__plot_is_disabled__(): import matplotlib.pyplot as plt -- GitLab