My video freezes after one second (not responding)

Thank you for the video.

this is my error and traceback:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
C:\Users\ALI~1.ARY\AppData\Local\Temp/ipykernel_6000/1925657203.py in <module>
      8 
      9     input_tensor = tf.convert_to_tensor(np.expand_dims(image_np, 0), dtype=tf.float32)
---> 10     detections = detect_fn(input_tensor)
     11 
     12     num_detections = int(detections.pop('num_detections'))

~\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\eager\def_function.py in __call__(self, *args, **kwds)
    887 
    888       with OptionalXlaContext(self._jit_compile):
--> 889         result = self._call(*args, **kwds)
    890 
    891       new_tracing_count = self.experimental_get_tracing_count()

~\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\eager\def_function.py in _call(self, *args, **kwds)
    915       # In this case we have created variables on the first call, so we run the
    916       # defunned version which is guaranteed to never create variables.
--> 917       return self._stateless_fn(*args, **kwds)  # pylint: disable=not-callable
    918     elif self._stateful_fn is not None:
    919       # Release the lock early so that multiple threads can perform the call

~\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\eager\function.py in __call__(self, *args, **kwargs)
   3020     with self._lock:
   3021       (graph_function,
-> 3022        filtered_flat_args) = self._maybe_define_function(args, kwargs)
   3023     return graph_function._call_flat(
   3024         filtered_flat_args, captured_inputs=graph_function.captured_inputs)  # pylint: disable=protected-access

~\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\eager\function.py in _maybe_define_function(self, args, kwargs)
   3442 
   3443           self._function_cache.missed.add(call_context_key)
-> 3444           graph_function = self._create_graph_function(args, kwargs)
   3445           self._function_cache.primary[cache_key] = graph_function
   3446 

~\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\eager\function.py in _create_graph_function(self, args, kwargs, override_flat_arg_shapes)
   3277     arg_names = base_arg_names + missing_arg_names
   3278     graph_function = ConcreteFunction(
-> 3279         func_graph_module.func_graph_from_py_func(
   3280             self._name,
   3281             self._python_function,

~\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\framework\func_graph.py in func_graph_from_py_func(name, python_func, args, kwargs, signature, func_graph, autograph, autograph_options, add_control_dependencies, arg_names, op_return_value, collections, capture_by_value, override_flat_arg_shapes)
    997         _, original_func = tf_decorator.unwrap(python_func)
    998 
--> 999       func_outputs = python_func(*func_args, **func_kwargs)
   1000 
   1001       # invariant: `func_outputs` contains only Tensors, CompositeTensors,

~\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\eager\def_function.py in wrapped_fn(*args, **kwds)
    670         # the function a weak reference to itself to avoid a reference cycle.
    671         with OptionalXlaContext(compile_with_xla):
--> 672           out = weak_wrapped_fn().__wrapped__(*args, **kwds)
    673         return out
    674 

~\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\framework\func_graph.py in wrapper(*args, **kwargs)
    984           except Exception as e:  # pylint:disable=broad-except
    985             if hasattr(e, "ag_error_metadata"):
--> 986               raise e.ag_error_metadata.to_exception(e)
    987             else:
    988               raise

ValueError: in user code:

    C:\Users\ALI~1.ARY\AppData\Local\Temp/ipykernel_6000/1654050223.py:11 detect_fn  *
        image, shapes = detection_model.preprocess(image)
    C:\Users\Ali.Aryo\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\meta_architectures\ssd_meta_arch.py:484 preprocess  *
        normalized_inputs, self._image_resizer_fn)
    C:\Users\Ali.Aryo\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\utils\shape_utils.py:492 resize_images_and_return_shapes  *
        outputs = static_or_dynamic_map_fn(
    C:\Users\Ali.Aryo\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\utils\shape_utils.py:246 static_or_dynamic_map_fn  *
        outputs = [fn(arg) for arg in tf.unstack(elems)]
    C:\Users\Ali.Aryo\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\core\preprocessor.py:3327 resize_image  *
        new_image = tf.image.resize_images(
    C:\Users\Ali.Aryo\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\util\dispatch.py:206 wrapper  **
        return target(*args, **kwargs)
    C:\Users\Ali.Aryo\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\ops\image_ops_impl.py:1538 resize_images
        return _resize_images_common(
    C:\Users\Ali.Aryo\Documents\TFOD_500\TFODCourse\tfod\lib\site-packages\tensorflow\python\ops\image_ops_impl.py:1396 _resize_images_common
        raise ValueError('\'images\' must have either 3 or 4 dimensions.')

    ValueError: 'images' must have either 3 or 4 dimensions.