Skip to content

Commit c4aaf47

Browse files
committed
Update tf_loader.py
1 parent 2ee6e54 commit c4aaf47

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tf2onnx/tf_loader.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,12 @@ def from_graphdef(model_path, input_names, output_names):
170170
with tf_gfile.GFile(model_path, 'rb') as f:
171171
try:
172172
content = f.read()
173-
except UnicodeDecodeError as e:
173+
except Exception as e:
174174
raise OSError(
175175
"Unable to load file '{}'.".format(model_path)) from e
176176
try:
177177
graph_def.ParseFromString(content)
178178
except Exception as e:
179-
print(content[:100])
180179
raise RuntimeError(
181180
"Unable to parse file '{}'.".format(model_path)) from e
182181
tf.import_graph_def(graph_def, name='')

0 commit comments

Comments
 (0)