nicknochnack / TFODCourse

944 stars 919 forks source link

IndexError: child index out of range #129

Closed chinhong11 closed 1 year ago

chinhong11 commented 1 year ago

The error appears when I try to do run STEP 3 - CREATE TF records and run the script

!python {files['TF_RECORD_SCRIPT']} -x {os.path.join(paths['IMAGE_PATH'], 'train')} -l {files['LABELMAP']} -o {os.path.join(paths['ANNOTATION_PATH'], 'train.record')}

!python {files['TF_RECORD_SCRIPT']} -x {os.path.join(paths['IMAGE_PATH'], 'test')} -l {files['LABELMAP']} -o {os.path.join(paths['ANNOTATION_PATH'], 'test.record')}

the error it shows is attached:

Traceback (most recent call last): File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\Tensorflow\scripts\generate_tfrecord.py", line 168, in <module> tf.app.run() File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\tfod\lib\site-packages\tensorflow\python\platform\app.py", line 36, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\tfod\lib\site-packages\absl\app.py", line 308, in run _run_main(main, args) File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\tfod\lib\site-packages\absl\app.py", line 254, in _run_main sys.exit(main(argv)) File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\Tensorflow\scripts\generate_tfrecord.py", line 155, in main examples = xml_to_csv(args.xml_dir) File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\Tensorflow\scripts\generate_tfrecord.py", line 88, in xml_to_csv int(member[4][0].text), IndexError: child index out of range Traceback (most recent call last): File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\Tensorflow\scripts\generate_tfrecord.py", line 168, in <module> tf.app.run() File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\tfod\lib\site-packages\tensorflow\python\platform\app.py", line 36, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\tfod\lib\site-packages\absl\app.py", line 308, in run _run_main(main, args) File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\tfod\lib\site-packages\absl\app.py", line 254, in _run_main sys.exit(main(argv)) File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\Tensorflow\scripts\generate_tfrecord.py", line 155, in main examples = xml_to_csv(args.xml_dir) File "D:\ObjectDetection\TensorFlow Object Detection\TFODCourse\Tensorflow\scripts\generate_tfrecord.py", line 88, in xml_to_csv int(member[4][0].text), IndexError: child index out of range