@@ -185,24 +185,24 @@ def assert_input_compatibility(input_spec, inputs, layer_name):
185185 if spec .ndim is not None and not spec .allow_last_axis_squeeze :
186186 if ndim != spec .ndim :
187187 raise ValueError (
188- f' Input { input_index } of layer " { layer_name } " '
189- " is incompatible with the layer: "
188+ f" Input { input_index } with name ' { spec . name } ' of layer "
189+ f"' { layer_name } ' is incompatible with the layer: "
190190 f"expected ndim={ spec .ndim } , found ndim={ ndim } . "
191191 f"Full shape received: { shape } "
192192 )
193193 if spec .max_ndim is not None :
194194 if ndim is not None and ndim > spec .max_ndim :
195195 raise ValueError (
196- f' Input { input_index } of layer " { layer_name } " '
197- " is incompatible with the layer: "
196+ f" Input { input_index } with name ' { spec . name } ' of layer "
197+ f"' { layer_name } ' is incompatible with the layer: "
198198 f"expected max_ndim={ spec .max_ndim } , "
199199 f"found ndim={ ndim } "
200200 )
201201 if spec .min_ndim is not None :
202202 if ndim is not None and ndim < spec .min_ndim :
203203 raise ValueError (
204- f' Input { input_index } of layer " { layer_name } " '
205- " is incompatible with the layer: "
204+ f" Input { input_index } with name ' { spec . name } ' of layer "
205+ f"' { layer_name } ' is incompatible with the layer: "
206206 f"expected min_ndim={ spec .min_ndim } , "
207207 f"found ndim={ ndim } . "
208208 f"Full shape received: { shape } "
@@ -212,8 +212,8 @@ def assert_input_compatibility(input_spec, inputs, layer_name):
212212 dtype = backend .standardize_dtype (x .dtype )
213213 if dtype != spec .dtype :
214214 raise ValueError (
215- f' Input { input_index } of layer " { layer_name } " '
216- " is incompatible with the layer: "
215+ f" Input { input_index } with name ' { spec . name } ' of layer "
216+ f"' { layer_name } ' is incompatible with the layer: "
217217 f"expected dtype={ spec .dtype } , "
218218 f"found dtype={ dtype } "
219219 )
@@ -226,11 +226,10 @@ def assert_input_compatibility(input_spec, inputs, layer_name):
226226 None ,
227227 }:
228228 raise ValueError (
229- f'Input { input_index } of layer "{ layer_name } " is '
230- f"incompatible with the layer: expected axis { axis } "
231- f"of input shape to have value { value } , "
232- "but received input with "
233- f"shape { shape } "
229+ f"Input { input_index } with name '{ spec .name } ' of layer "
230+ f"'{ layer_name } ' is incompatible with the layer: "
231+ f"expected axis { axis } of input shape to have value "
232+ f"{ value } , but received input with shape { shape } "
234233 )
235234 # Check shape.
236235 if spec .shape is not None :
@@ -244,8 +243,8 @@ def assert_input_compatibility(input_spec, inputs, layer_name):
244243 if spec_dim is not None and dim is not None :
245244 if spec_dim != dim :
246245 raise ValueError (
247- f' Input { input_index } of layer " { layer_name } " is '
248- " incompatible with the layer: "
249- f"expected shape={ spec .shape } , "
250- f"found shape={ shape } "
246+ f" Input { input_index } with name ' { spec . name } ' of "
247+ f"layer ' { layer_name } ' is incompatible with the "
248+ f"layer: expected shape={ spec .shape } , found "
249+ f"shape={ shape } "
251250 )
0 commit comments