title: UnicodeDecodeError(utf-8) occurs when I load the model in [Object Detection_setting for drawing result with checkpoints] process
body: <p>how's it going!!</p>
  <p>This is my first question, so I may be lacking a lot. It's my first time working on machine learning, but I don't want to give up here. I would be very grateful if you could help me.</p>
  <p>I currently set up an environment to use the object detection model at the Anaconda prompt. And now I work to view the results on the Jupyter notebook.</p>
  <p>DecodeError often occurred in the environment setting stage, but as I created the virtual environment several times, I was able to move on somehow</p>
  <p><strong>Could you read this PLEASE?</strong></p>
  <p>first, after running the code on Jupyter notebook like this,,</p>
  <pre><code>import os, fnmatch
  os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'    # Suppress TensorFlow logging (1)
  
  import pathlib
  import tensorflow as tf
  #tf.get_logger().setLevel('ERROR')           # Suppress TensorFlow logging (2)
  
  listOffiles = os.listdir('./test_data-1')  ##### 수정
  Img_filenames = []
  print(listOffiles)
  # Enable GPU dynamic memory allocation
  #gpus = tf.config.experimental.list_physical_devices('GPU')
  #for gpu in gpus:
  #    tf.config.experimental.set_memory_growth(gpu, True)
  
  def Load_images():
      base_path = &quot;C:\tf_1125\workspace\training_demo\test_data-1/&quot;   #####수정
      pattern = &quot;*.jpg&quot;  #####수정
      for entry in listOffiles: ## Get file names
          if fnmatch.fnmatch(entry, pattern):
              entry = base_path + entry
              Img_filenames.append(str(entry))
              #print(entry)
      image_paths = []
  
      for filename in Img_filenames:
          #image_path = base_path + filename
          image_path = filename
          #image_path = pathlib.Path(image_path)
          image_paths.append(str(image_path))
          #print(filename)
      return image_paths
  
  IMAGE_PATHS = Load_images()
  print (IMAGE_PATHS)
  </code></pre>
  <p>Next, I load the models.</p>
  <pre><code>import time
  from object_detection.utils import label_map_util
  from object_detection.utils import config_util
  from object_detection.utils import visualization_utils as viz_utils
  from object_detection.builders import model_builder
  
  PATH_TO_MODEL_DIR = &quot;C:\tf_1125\workspace\training_demo\models\my_ssd_resnet50_v1_fpn&quot;  #####수정
  
  PATH_TO_CFG = PATH_TO_MODEL_DIR + &quot;/pipeline.config&quot;
  PATH_TO_CKPT = PATH_TO_MODEL_DIR + &quot;/&quot;
  
  print('Loading model... ', end='')
  start_time = time.time()
  
  # Load pipeline config and build a detection model
  configs = config_util.get_configs_from_pipeline_file(PATH_TO_CFG)
  model_config = configs['model']
  detection_model = model_builder.build(model_config=model_config, is_training=False)
  
  # Restore checkpoint
  ckpt = tf.compat.v2.train.Checkpoint(model=detection_model)
  ckpt.restore(os.path.join(PATH_TO_CKPT, 'ckpt-1')).expect_partial()
  
  @tf.function
  def detect_fn(image):
      &quot;&quot;&quot;Detect objects in image.&quot;&quot;&quot;
  
      image, shapes = detection_model.preprocess(image)
      prediction_dict = detection_model.predict(image, shapes)
      detections = detection_model.postprocess(prediction_dict, shapes)
  
      return detections
  
  end_time = time.time()
  elapsed_time = end_time - start_time
  print('Done! Took {} seconds'.format(elapsed_time))
  </code></pre>
  <p><strong>The problem is here!</strong> In this process, I met ‘UnicodeDecodeError ’</p>
  <pre><code>---------------------------------------------------------------------------
  UnicodeDecodeError                        Traceback (most recent call last)
  ~\AppData\Local\Temp/ipykernel_13256/3247142710.py in &lt;module&gt;
       14 
       15 # Load pipeline config and build a detection model
  ---&gt; 16 configs = config_util.get_configs_from_pipeline_file(PATH_TO_CFG)
       17 model_config = configs['model']
       18 detection_model = model_builder.build(model_config=model_config, is_training=False)
  
  c:\anaconda\envs\tenf\lib\site-packages\object_detection\utils\config_util.py in get_configs_from_pipeline_file(pipeline_config_path, config_override)
      136   pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
      137   with tf.gfile.GFile(pipeline_config_path, &quot;r&quot;) as f:
  --&gt; 138     proto_str = f.read()
      139     text_format.Merge(proto_str, pipeline_config)
      140   if config_override:
  
  c:\anaconda\envs\tenf\lib\site-packages\tensorflow\python\lib\io\file_io.py in read(self, n)
      115       string if in string (regular) mode.
      116     &quot;&quot;&quot;
  --&gt; 117     self._preread_check()
      118     if n == -1:
      119       length = self.size() - self.tell()
  
  c:\anaconda\envs\tenf\lib\site-packages\tensorflow\python\lib\io\file_io.py in _preread_check(self)
       78                                            &quot;File isn't open for reading&quot;)
       79       self._read_buf = _pywrap_file_io.BufferedInputStream(
  ---&gt; 80           compat.path_to_str(self.__name), 1024 * 512)
       81 
       82   def _prewrite_check(self):
  </code></pre>
  <p>UTF-8 =&gt; Even though I decode UTF-8(through decoding exe file or notepad++), there is no sign of resolution. If there's anyone who solved the same error as me, please share your knowledge!</p>
  <p>Thank you for reading my comment. :)</p>