error when run python create_tf_record.py --data_dir=`pwd` --output_dir=`pwd`
Closed this issue · 2 comments
Hi,
When I run python create_tf_record.py --data_dir=pwd
--output_dir=pwd
command, I found error:
File "create_tf_record.py", line 180, in <module> tf.app.run() File "/home/administrator/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "create_tf_record.py", line 175, in main image_dir, train_examples) File "create_tf_record.py", line 147, in create_tf_record tf_example = dict_to_tf_example(data, label_map_dict, image_dir) File "create_tf_record.py", line 60, in dict_to_tf_example img_path = os.path.join(image_subdirectory, data['filename']) TypeError: string indices must be integers, not str
Looks like the variable data
is being read as a list rather a dictionary. Are you sure you set up the xml files properly? Make sure the xml files and images have the same name, and trainval.txt
has the names set up properly.
I checked xml file properly, it was right.
I clone all of your repo and follow step on medium. So I don't know what wrong is it.