models icon indicating copy to clipboard operation
models copied to clipboard

Weird erros at training ... (train.py)

Open MyVanitar opened this issue 8 years ago • 3 comments

Hello,

I could not solve these errors:

WARNING:tensorflow:From D:\Image_Processing\TFOD\models-master\models-master\research\object_detection\trainer.py:228: create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.create_global_step
Traceback (most recent call last):
  File "D:\Image_Processing\TFOD\models-master\models-master\research\object_detection\utils\label_map_util.py", line 132, in load_labelmap
    text_format.Merge(label_map_string, label_map)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 525, in Merge
    descriptor_pool=descriptor_pool)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 579, in MergeLines
    return parser.MergeLines(lines, message)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 612, in MergeLines
    self._ParseOrMerge(lines, message)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 627, in _ParseOrMerge
    self._MergeField(tokenizer, message)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 727, in _MergeField
    merger(tokenizer, message, field)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 815, in _MergeMessageField
    self._MergeField(tokenizer, sub_message)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 727, in _MergeField
    merger(tokenizer, message, field)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 866, in _MergeScalarField
    value = tokenizer.ConsumeString()
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 1229, in ConsumeString
    the_bytes = self.ConsumeByteString()
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 1244, in ConsumeByteString
    the_list = [self._ConsumeSingleByteString()]
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\text_format.py", line 1263, in _ConsumeSingleByteString
    raise self.ParseError('Expected string but found: %r' % (text,))
google.protobuf.text_format.ParseError: 3:8 : Expected string but found: '‘'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\internal\python_message.py", line 1069, in MergeFromString
    if self._InternalParse(serialized, 0, length) != length:
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\internal\python_message.py", line 1091, in InternalParse
    (tag_bytes, new_pos) = local_ReadTag(buffer, pos)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\internal\decoder.py", line 181, in ReadTag
    while six.indexbytes(buffer, pos) & 0x80:
TypeError: unsupported operand type(s) for &: 'str' and 'int'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 169, in <module>
    tf.app.run()
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\tensorflow\python\platform\app.py", line 124, in run
    _sys.exit(main(argv))
  File "train.py", line 165, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "D:\Image_Processing\TFOD\models-master\models-master\research\object_detection\trainer.py", line 235, in train
    train_config.prefetch_queue_capacity, data_augmentation_options)
  File "D:\Image_Processing\TFOD\models-master\models-master\research\object_detection\trainer.py", line 59, in create_input_queue
    tensor_dict = create_tensor_dict_fn()
  File "train.py", line 122, in get_next
    worker_index=FLAGS.task)).get_next()
  File "D:\Image_Processing\TFOD\models-master\models-master\research\object_detection\builders\dataset_builder.py", line 140, in build
    label_map_proto_file=label_map_proto_file)
  File "D:\Image_Processing\TFOD\models-master\models-master\research\object_detection\data_decoders\tf_example_decoder.py", line 143, in __init__
    use_display_name)
  File "D:\Image_Processing\TFOD\models-master\models-master\research\object_detection\utils\label_map_util.py", line 149, in get_label_map_dict
    label_map = load_labelmap(label_map_path)
  File "D:\Image_Processing\TFOD\models-master\models-master\research\object_detection\utils\label_map_util.py", line 134, in load_labelmap
    label_map.ParseFromString(label_map_string)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\message.py", line 185, in ParseFromString
    self.MergeFromString(serialized)
  File "C:\Users\Hesam\AppData\Local\conda\conda\envs\tfod\lib\site-packages\google\protobuf\internal\python_message.py", line 1075, in MergeFromString
    raise message_mod.DecodeError('Truncated message.')
google.protobuf.message.DecodeError: Truncated message.

MyVanitar avatar Feb 11 '18 14:02 MyVanitar

The problem has fixed. actually inside the label_map.pbtxt the name of the object must be enclosed with " " not with ' '

Now I have a different problem. Although I have installed Cuda 9.0, but the model mostly train on CPU and very little on GPU

MyVanitar avatar Feb 11 '18 20:02 MyVanitar

(tens-test) C:\tensorflow1\models\research\object_detection\legacy>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config WARNING:tensorflow: The TensorFlow contrib module will not be included in TensorFlow 2.0. For more information, please see:

  • https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  • https://github.com/tensorflow/addons
  • https://github.com/tensorflow/io (for I/O related ops) If you depend on functionality not listed there, please file an issue.

WARNING:tensorflow:From train.py:56: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

WARNING:tensorflow:From train.py:56: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.

WARNING:tensorflow:From train.py:185: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

WARNING:tensorflow:From C:\Users\aligk\Anaconda3\envs\tens-test\lib\site-packages\absl\app.py:250: main (from main) is deprecated and will be removed in a future version. Instructions for updating: Use object_detection/model_main.py. W0215 03:06:27.020666 8080 deprecation.py:323] From C:\Users\aligk\Anaconda3\envs\tens-test\lib\site-packages\absl\app.py:250: main (from main) is deprecated and will be removed in a future version. Instructions for updating: Use object_detection/model_main.py. WARNING:tensorflow:From train.py:91: The name tf.gfile.MakeDirs is deprecated. Please use tf.io.gfile.makedirs instead.

W0215 03:06:27.025681 8080 module_wrapper.py:139] From train.py:91: The name tf.gfile.MakeDirs is deprecated. Please use tf.io.gfile.makedirs instead.

WARNING:tensorflow:From C:\tensorflow1\models\research\object_detection\utils\config_util.py:102: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

W0215 03:06:27.031661 8080 module_wrapper.py:139] From C:\tensorflow1\models\research\object_detection\utils\config_util.py:102: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

Windows fatal exception: access violation

Current thread 0x00001f90 (most recent call first): File "C:\Users\aligk\Anaconda3\envs\tens-test\lib\site-packages\tensorflow_core\python\lib\io\file_io.py", line 84 in _preread_check File "C:\Users\aligk\Anaconda3\envs\tens-test\lib\site-packages\tensorflow_core\python\lib\io\file_io.py", line 122 in read File "C:\tensorflow1\models\research\object_detection\utils\config_util.py", line 103 in get_configs_from_pipeline_file File "train.py", line 94 in main File "C:\Users\aligk\Anaconda3\envs\tens-test\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 324 in new_func File "C:\Users\aligk\Anaconda3\envs\tens-test\lib\site-packages\absl\app.py", line 250 in _run_main File "C:\Users\aligk\Anaconda3\envs\tens-test\lib\site-packages\absl\app.py", line 299 in run File "C:\Users\aligk\Anaconda3\envs\tens-test\lib\site-packages\tensorflow_core\python\platform\app.py", line 40 in run File "train.py", line 185 in

aligokkaya avatar Feb 15 '20 00:02 aligokkaya

help please

aligokkaya avatar Feb 15 '20 00:02 aligokkaya