Skip to content

Commit

Permalink
Import pydot first before trying backups (#20682)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkk7 authored Dec 23, 2024
1 parent 3dd958b commit c1316e5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions keras/src/utils/model_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
from keras.src.utils import io_utils

try:
# pydot-ng is a fork of pydot that is better maintained.
import pydot_ng as pydot
import pydot
except ImportError:
# pydotplus is an improved version of pydot
# pydot_ng and pydotplus are older forks of pydot
# which may still be used by some users
try:
import pydotplus as pydot
import pydot_ng as pydot
except ImportError:
# Fall back on pydot if necessary.
try:
import pydot
import pydotplus as pydot
except ImportError:
pydot = None

Expand Down

0 comments on commit c1316e5

Please sign in to comment.