TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10
TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 copied to clipboard
Couldn't run generate_tfrecord.py
While executing python generate_tfrecord.py, encountering this error.
while executing python generate_tfrecord.py --csv_input=images\train_labels.csv --output_path=train.record --image_dir=images\train , encountering this error.

In your generate_tfrecord.py file make sure the last else statement is return 0 instead of None
def class_text_to_int(row_label): if row_label == 'basketball': return 1 elif row_label == 'shirt': return 2 elif row_label == 'shoe': return 3 else: None
I tried to use the markup for adding code, sorry it did not stay formatted. but you should figure it out.
did you figured out how to solve the problem? because i have the same error
@nika9774 Yes I did. It is like in the post above. In the generate_tfrecord.py look for the function you modified to match your lablemap.pbtxt file. At the end of the IF statement is the else:None to wrap it up. You have to change that else:None to else:0. (else:zero) That function (class_text_to_int) needs to return all ints, it is the None being returned that is causing the problem downstream.
thank you. it worked!
Good to hear it have fun
i have problem when i run file generate_tfrecord.py.