When we run the SSD TensorFlow version, the following issues occur, and the command I run is:
dataset_dir=voc2012/
output_dir=tfrecords
python tf_convert_data.py \
--dataset_name=pascalvoc \
--dataset_dir=${dataset_dir} \
--output_name=voc_2012_train \
--output_dir=${output_dir}
Through Baidu is not found GitHub above the issues above the answer, I am here to solve the problem to write out, hoping to help you play SSD. The error message is:
Converting image 1/5138traceback (most recent call last): File "tf_convert_data.py", line <module> TF. App.run () File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line and in run _sys.exit
(Main (_sys.argv[:1] + Flags_passthrough)) File "tf_convert_data.py", line Si, in main pascalvoc_to_tfrecords.run (Flags.dataset_dir, Flags.output_dir, FLAGS.OUTP Ut_name) File "/home/xyxt/downloads/ssd-tensorflow/datasets/pascalvoc_to_tfrecords.py", line 218, in Run _ADD_TO_TFR Ecord (Dataset_dir, Img_name, Tfrecord_writer) File "/home/xyxt/downloads/ssd-tensorflow/datasets/pascalvoc_to_ tfrecords.py ", line 177, in _add_to_tfrecord _process_image (dataset_dir, name) File"/home/xyxt/downloads/ssd-tensor flow/datasets/pascalvoc_to_tfrecords.py ", line, _process_image image_data = tf.gfile.FastGFile (filename, ' R '). Re
AD () File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/lib/io/file_io.py", line 126, in readPywrap_tensorflow. ReadFromStream (self._read_buf, length, status)) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/lib /io/file_io.py ", line, in _prepare_value return Compat.as_str_any (val) file"/usr/local/lib/python3.5/dist-packag es/tensorflow/python/util/compat.py ", line, As_str_any return As_str (value) File/usr/local/lib/python3.5/di st-packages/tensorflow/python/util/compat.py ", line A, in As_text return Bytes_or_text.decode (encoding) unicodedecod Eerror: ' Utf-8 ' codec can ' t decode byte 0xff in position 0:invalid start byte
The solution is:
pascalvoc_to_tfrecords.py
Image_data = tf.gfile.FastGFile (filename, ' r '). Read ()
Change into:
Image_data = tf.gfile.FastGFile (filename, ' RB '). Read ()
It's OK.
Reference Documents [1].can ' t create DataSet: ' Utf-8 ' codec can ' t decode byte 0xff in position 0:invalid start byte. https://github.com/balancap/SSD-Tensorflow/issues/108