models icon indicating copy to clipboard operation
models copied to clipboard

training on own dataset- label generation

Open fib5813 opened this issue 9 years ago • 4 comments

I have a labeled dataset and I am trying to convert it to the tfrecord format using the code provided in the tutorial. does the python script require any input arguments? I get the following error. how do I run this script? Traceback (most recent call last): File "./tfrconverter.py", line 68, in <module> tf.app.run() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "./tfrconverter.py", line 58, in main writer = tf.python_io.TFRecordWriter(FLAGS.output_path) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/lib/io/tf_record.py", line 106, in __init__ compat.as_bytes(path), compat.as_bytes(compression_type), status) File "/usr/lib/python3.5/contextlib.py", line 66, in __exit__ next(self.gen) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.FailedPreconditionError

fib5813 avatar Jul 20 '17 14:07 fib5813

I apologize but I am having a hard time understanding what the problem is, where the problem is, and what version it affects. Please resubmit and pay attention to the issue template (https://github.com/tensorflow/tensorflow/issues/new) . Please provide all the information it asks. In particular, exact steps to reproduce the problem will be most useful. Thank you.

asimshankar avatar Jul 20 '17 16:07 asimshankar

sorry for being vague,


System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): linux ubuntu 14.04
  • TensorFlow installed from (source or binary): source
  • TensorFlow version (use command below): 1.2
  • Python version: 3.5
  • Bazel version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:
  • Exact command to reproduce:

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

You can obtain the TensorFlow version with

python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

Describe the problem

I have written a code to convert my current labels to tfrecords using the script given at https://github.com/tensorflow/models/blob/master/object_detection/g3doc/using_your_own_dataset.md#conversion-script-outline as template. I have attached the code below. when i try to run the code using ./tfrconverter.py --output_path= ./ i get the following error: smb://10.90.66.124/src/urvashi/tensorflow_tests/mixed/tfrconverter.pyTraceback (most recent call last): File "./tfrconverter.py", line 68, in <module> tf.app.run() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "./tfrconverter.py", line 58, in main writer = tf.python_io.TFRecordWriter(FLAGS.output_path) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/lib/io/tf_record.py", line 106, in __init__ compat.as_bytes(path), compat.as_bytes(compression_type), status) File "/usr/lib/python3.5/contextlib.py", line 66, in __exit__ next(self.gen) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.FailedPreconditionError: ./

Source code / logs

air4 this is the labeled image air4.txt this is the label file containing the bounding boxes tfrconverter.txt here is the code that is supposed to convert the label file contents to tfrecords

fib5813 avatar Jul 20 '17 19:07 fib5813

I think the problem is in the flags that I am trying to use. what is the proper way to use the flags while running this script?

fib5813 avatar Jul 21 '17 17:07 fib5813

i got it. i had to run it as: ./tfrconverter.py --output_path=outfile.records

fib5813 avatar Jul 21 '17 17:07 fib5813