For Week 2:
When creating the model using the tensorflow hub SSD MobileNet V2 model, following error is coming:
TypeError Traceback (most recent call last)
Cell In [58], line 2
1 detector = hub.load(“TensorFlow | ssd_mobilenet_v2 | Kaggle”)
----> 2 detector_output = detector(converted_img)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\saved_model\load.py:816, in _call_attribute(instance, *args, **kwargs)
815 def _call_attribute(instance, *args, **kwargs):
→ 816 return instance.call(*args, **kwargs)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\util\traceback_utils.py:153, in filter_traceback..error_handler(*args, **kwargs)
151 except Exception as e:
152 filtered_tb = _process_traceback_frames(e.traceback)
→ 153 raise e.with_traceback(filtered_tb) from None
154 finally:
155 del filtered_tb
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\eager\polymorphic_function\function_type_utils.py:446, in bind_function_inputs(args, kwargs, function_type, default_values)
442 bound_arguments = function_type.bind_with_defaults(
443 args, sanitized_kwargs, default_values
444 )
445 except Exception as e:
→ 446 raise TypeError(
447 f"Binding inputs to tf.function failed due to {e}
. "
448 f"Received args: {args} and kwargs: {sanitized_kwargs} for signature:"
449 f" {function_type}."
450 ) from e
451 return bound_arguments
TypeError: Binding inputs to tf.function failed due to Can not cast TensorSpec(shape=(1, 2592, 3872, 3), dtype=tf.float32, name=None) to TensorSpec(shape=(1, None, None, 3), dtype=tf.uint8, name=None)
. Received args: (<tf.Tensor: shape=(1, 2592, 3872, 3), dtype=float32,