Fix plot_model for PDF

This commit is contained in:
“jaketae” 2020-03-02 06:46:35 +09:00
parent 37637ae605
commit 82a6ba4c50

View File

@ -293,8 +293,9 @@ def plot_model(model,
# Return the image as a Jupyter Image object, to be displayed in-line.
# Note that we cannot easily detect whether the code is running in a
# notebook, and thus we always return the Image if Jupyter is available.
try:
from IPython import display
return display.Image(filename=to_file)
except ImportError:
pass
if extension != 'pdf':
try:
from IPython import display
return display.Image(filename=to_file)
except ImportError:
pass