'tensorflow.python.lib.io._pywrap_file_io.BufferedInputStream(filename: str, buffer_size: int, token: tensorflow.python.lib.i

I have a problem while converting from xmls to TFrecords. Here the problem with the code

!python {GTFrecords + 'generate_tfrecord.py'} -x {IMAGE_PATH + '/train'} -l {label_map} -o {ANNOTATION_PATH + '/train.record'}

and here is the error

    Traceback (most recent call last):
  File "C:\Users\itta_\Documents\python_projects\SignLanguage\Tensorflow\scripts\generate_tfrecord.py", line 62, in <module>
    label_map_dict = label_map_util.get_label_map_dict(label_map)
  File "C:\Nouveau dossier\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:\Nouveau dossier\lib\site-packages\object_detection\utils\label_map_util.py", line 133, in load_labelmap
    label_map_string = fid.read()
  File "C:\Nouveau dossier\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 117, in read
    self._preread_check()
  File "C:\Nouveau dossier\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 79, 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: item {
  name: "Hello"
  id: 1
}
item {
  name: "Help"
  id: 2
}
item {
  name: "I Love You"
  id: 3
show more (open the raw output data in a text editor) ...

item {
  name: "Yes"
  id: 8
}
, 524288

Can anyone help me please ? thank you



Solution 1:[1]

I had a similar issue. But I has solved by changing the line 62 in generate_tfrecord.py from

label_map_dict = label_map_util.get_label_map_dict(label_map)

to

label_map_dict = label_map_util.get_label_map_dict(args.labels_path)

Sources

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

Source: Stack Overflow

Solution Source
Solution 1 haoenlu