yinguobing / tfrecord_utility

Generate and view TensorFlow's TFRecord file.
MIT License
28 stars 18 forks source link

tfrecord生成报错 #4

Closed JeQer closed 5 years ago

JeQer commented 5 years ago

请问在生成record时,报如下错误如何解决呀:

C:\Users\Administrator\Anaconda3\envs\tensorflow-gpu\python.exe E:/PycharmProjects/cnn-facial-landmark/data_train/generate_tfrecord.py --csv_input=./data_train.csv --img_folder=../data/json/landmark --output_file=train.record Traceback (most recent call last): File "C:\Users\Administrator\Anaconda3\envs\tensorflow-gpu\lib\site-packages\pandas\core\indexes\base.py", line 4381, in get_value return libindex.get_value_box(s, key) File "pandas/_libs/index.pyx", line 52, in pandas._libs.index.get_value_box File "pandas/_libs/index.pyx", line 48, in pandas._libs.index.get_value_at File "pandas/_libs/util.pxd", line 113, in pandas._libs.util.get_value_at File "pandas/_libs/util.pxd", line 98, in pandas._libs.util.validate_indexer TypeError: 'str' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:/PycharmProjects/cnn-facial-landmark/data_train/generate_tfrecord.py", line 107, in tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) File "C:\Users\Administrator\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "E:/PycharmProjects/cnn-facial-landmark/data_train/generate_tfrecord.py", line 81, in main current_example = _create_tf_example(row) File "E:/PycharmProjects/cnn-facial-landmark/data_train/generate_tfrecord.py", line 47, in _create_tf_example '{}'.format(data['name'])) File "C:\Users\Administrator\Anaconda3\envs\tensorflow-gpu\lib\site-packages\pandas\core\series.py", line 868, in getitem result = self.index.get_value(self, key) File "C:\Users\Administrator\Anaconda3\envs\tensorflow-gpu\lib\site-packages\pandas\core\indexes\base.py", line 4389, in get_value raise e1 File "C:\Users\Administrator\Anaconda3\envs\tensorflow-gpu\lib\site-packages\pandas\core\indexes\base.py", line 4375, in get_value tz=getattr(series.dtype, 'tz', None)) File "pandas/_libs/index.pyx", line 81, in pandas._libs.index.IndexEngine.get_value File "pandas/_libs/index.pyx", line 89, in pandas._libs.index.IndexEngine.get_value File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'name'

Process finished with exit code 1

abdou31 commented 5 years ago

Same issue , Did you solve this error?

wangping1408 commented 5 years ago

Hello, may you have a solution to this problem? I have encountered the same problem. @UestcZbq

abdou31 commented 5 years ago

@wangping1408 I solved this issue by using another script than generate_tfrecord.py