diff --git a/python/paddle/v2/plot/plot.py b/python/paddle/v2/plot/plot.py index a685036970284684112e0c2b75d2705c26f15003..6f7bd039b07db4832295c2374293bffa588eb4ef 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