Updated import to make it work with pydotplus
authorHugo Serrat <hu.serrat@gmail.com>
Thu, 21 Jan 2016 13:34:01 +0000 (14:34 +0100)
committerHugo Serrat <hu.serrat@gmail.com>
Mon, 25 Jan 2016 10:25:37 +0000 (11:25 +0100)
python/caffe/draw.py

index f8bf572..cfa3fc5 100644 (file)
@@ -10,7 +10,16 @@ Caffe network visualization: draw the NetParameter protobuffer.
 """
 
 from caffe.proto import caffe_pb2
-import pydot
+
+"""
+pydot is not supported under python 3 and pydot2 doesn't work properly.
+pydotplus works nicely (pip install pydotplus)
+"""
+try:
+    # Try to load pydotplus
+    import pydotplus as pydot
+except ImportError:
+    import pydot
 
 # Internal layer and blob styles.
 LAYER_STYLE_DEFAULT = {'shape': 'record',