'Another approach to create and form Tfrecord for training and testing data

I am currently using this command to create a train.record file

!py generate_tfrecord.py -x C:/Users/Desktop/dataset/Workspace/images/train -l C:/User/Desktop/dataset/Workspace/annotations/Annotations/Train/train.record

I get the following error

Traceback (most recent call last):
  File "c:\Users\Desktop\dataset\generate_tfrecord.py", line 62, in <module>
    label_map_dict = label_map_util.get_label_map_dict(label_map)
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\object_detection\utils\label_map_util.py", line 164, in get_label_map_dict
    label_map = load_labelmap(label_map_path)
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\object_detection\utils\label_map_util.py", line 133, in load_labelmap
    label_map_string = fid.read()
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 114, in read
    self._preread_check()
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 76, in _preread_check
    self._read_buf = _pywrap_file_io.BufferedInputStream(
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
    1. tensorflow.python.lib.io._pywrap_file_io.BufferedInputStream(filename: str, buffer_size: int, token: tensorflow.python.lib.io._pywrap_file_io.TransactionToken = None)

Invoked with: , 524288

There is an answer here I did try but still not working for me any thoughts Error when converting xml files to tfrecord files



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source