1
+ import traceback
1
2
import warnings
2
3
from abc import ABC , abstractmethod
3
4
from typing import List , Optional , Sequence , Tuple , Union , final
@@ -76,7 +77,7 @@ def create(
76
77
devices = devices ,
77
78
)
78
79
except Exception as e :
79
- errors .append (f"{ wf } : { e } " )
80
+ errors .append (f"{ wf } : { e } \n { traceback . format_stack () } " )
80
81
elif (
81
82
wf == "tensorflow_saved_model_bundle"
82
83
and weights .tensorflow_saved_model_bundle is not None
@@ -88,7 +89,7 @@ def create(
88
89
model_description = model_description , devices = devices
89
90
)
90
91
except Exception as e :
91
- errors .append (f"{ wf } : { e } " )
92
+ errors .append (f"{ wf } : { e } \n { traceback . format_stack () } " )
92
93
elif wf == "onnx" and weights .onnx is not None :
93
94
try :
94
95
from ._onnx_model_adapter import ONNXModelAdapter
@@ -97,7 +98,7 @@ def create(
97
98
model_description = model_description , devices = devices
98
99
)
99
100
except Exception as e :
100
- errors .append (f"{ wf } : { e } " )
101
+ errors .append (f"{ wf } : { e } \n { traceback . format_stack () } " )
101
102
elif wf == "torchscript" and weights .torchscript is not None :
102
103
try :
103
104
from ._torchscript_model_adapter import TorchscriptModelAdapter
@@ -106,7 +107,7 @@ def create(
106
107
model_description = model_description , devices = devices
107
108
)
108
109
except Exception as e :
109
- errors .append (f"{ wf } : { e } " )
110
+ errors .append (f"{ wf } : { e } \n { traceback . format_stack () } " )
110
111
elif wf == "keras_hdf5" and weights .keras_hdf5 is not None :
111
112
# keras can either be installed as a separate package or used as part of tensorflow
112
113
# we try to first import the keras model adapter using the separate package and,
@@ -124,7 +125,7 @@ def create(
124
125
model_description = model_description , devices = devices
125
126
)
126
127
except Exception as e :
127
- errors .append (f"{ wf } : { e } " )
128
+ errors .append (f"{ wf } : { e } \n { traceback . format_stack () } " )
128
129
129
130
assert errors
130
131
error_list = "\n - " .join (errors )
0 commit comments