models icon indicating copy to clipboard operation
models copied to clipboard

Error while training the model on custom dataset

Open Ghost123Writer opened this issue 9 years ago • 6 comments

System information

  • OS Platform and Distribution : Linux Ubuntu 16.04:
  • TensorFlow installed from pip on anaconda3
  • TensorFlow version: v1.2.0-rc2-21-g12f033d 1.2.0
  • CUDA/cuDNN version: 8.0
  • GPU model and memory: Quadro K2200 4 GB

The directory tree is as follows (as specified by ):


+ models-master
        + object_detection
               + data
                       - windmill_label_map.pbtxt
                       - windmill_train.record
                       - windmill_val.record
               + models
                       + model
                              + eval
                              + train
                              - faster_rcnn_resnet101_windmill.config 

Describe the problem

I am using the API to detect windmills from satellite images. I created the dataset (each image of size 1024x1024x3) and annotations in same manner as pets dataset. I successfully converted my dataset and annotations into tf.record files by modifying the existing create_pet_tf_record.py.I also modified the faster_rcnn_resnet101_pets.config file to specifications of my data set. however when I try to train the model using :

python object_detection/train.py \
    --logtostderr \
    --pipeline_config_path=/home/rrscw/models-master/object_detection/models/model/faster_rcnn_resnet101_windmill.config \
    --train_dir=/home/rrscw/models-master/object_detection/models/model/train

I receive an error: TypeError: '<' not supported between instances of 'tuple' and 'str (the full log is provided below)

The config and pbtxt file for training are attached as a zip file along with a sample training and validation tf record. Files.zip

Source code / logs


INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
Traceback (most recent call last):
  File "object_detection/train.py", line 198, in <module>
    tf.app.run()
  File "/home/rrscw/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "object_detection/train.py", line 194, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/rrscw/models-master/object_detection/trainer.py", line 184, in train
    data_augmentation_options)
  File "/home/rrscw/models-master/object_detection/trainer.py", line 77, in _create_input_queue
    prefetch_queue_capacity=prefetch_queue_capacity)
  File "/home/rrscw/models-master/object_detection/core/batcher.py", line 93, in __init__
    num_threads=num_batch_queue_threads)
  File "/home/rrscw/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/input.py", line 919, in batch
    name=name)
  File "/home/rrscw/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/input.py", line 697, in _batch
    tensor_list = _as_tensor_list(tensors)
  File "/home/rrscw/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/input.py", line 385, in _as_tensor_list
    return [tensors[k] for k in sorted(tensors)]
TypeError: '<' not supported between instances of 'tuple' and 'str

How do I resolve this error?

Ghost123Writer avatar Jul 01 '17 06:07 Ghost123Writer

@Ghost123Writer Did you try to train voc or pet dataset following the tutorial? When I have did it, I met the same problem!

xhzcyc avatar Jul 01 '17 09:07 xhzcyc

@xhzcyc I did not but I think the error might be the same, how did you resolve it?

Ghost123Writer avatar Jul 02 '17 04:07 Ghost123Writer

@Ghost123Writer I had the same issue, but switched and Python 2 and it worked.

manlito avatar Jul 03 '17 12:07 manlito

@manlito You are right. I done it using python2.

xhzcyc avatar Jul 04 '17 08:07 xhzcyc

I am using python 3.6 I will try it with Python2.7 and close the issue if it works

Ghost123Writer avatar Jul 04 '17 17:07 Ghost123Writer

The error is resolved when I am using Python 2.7

Ghost123Writer avatar Jul 04 '17 18:07 Ghost123Writer