models icon indicating copy to clipboard operation
models copied to clipboard

accoon\labelmap.pbtxt : \udcceļ\udcfe\udcc3\udcfb\udca1\udca2Ŀ¼\udcc3\udcfb\udcbb\udcf2\udcbe\udced\udcb1\udcea\udcd3﷨\udcb2\udcbb\udcd5\udcfdȷ\udca1\udca3 ; Unknown error

Open Distance789 opened this issue 8 years ago • 0 comments

Please go to Stack Overflow for help and support:

http://stackoverflow.com/questions/tagged/tensorflow

Also, please understand that many of the models included in this repository are experimental and research-style code. If you open a GitHub issue, here is our policy:

  1. It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
  2. The form below must be filled out.

Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.


System information

  • What is the top-level directory of the model you are using:
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):win10
  • TensorFlow installed from (source or binary):windows anaconda3
  • TensorFlow version (use command below):tensorflow-cpu-1.6
  • Bazel version (if compiling from source):
  • CUDA/cuDNN version:CUDA8.0
  • GPU model and memory:CPU
  • 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

Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request. use train.py to train data,have problem about label.pbtxt file.

errors Traceback (most recent call last): File "E:/raccoon/train.py", line 191, in tf.app.run() File "E:\Python36\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run _sys.exit(main(argv)) File "E:/raccoon/train.py", line 187, in main graph_hook_fn=graph_rewriter_fn) File "E:\models\research\object_detection\legacy\trainer.py", line 277, in train train_config.prefetch_queue_capacity, data_augmentation_options) File "E:\models\research\object_detection\legacy\trainer.py", line 59, in create_input_queue tensor_dict = create_tensor_dict_fn() File "E:/raccoon/train.py", line 128, in get_next dataset_builder.build(config)).get_next() File "E:\models\research\object_detection\builders\dataset_builder.py", line 123, in build num_additional_channels=input_reader_config.num_additional_channels) File "E:\models\research\object_detection\data_decoders\tf_example_decoder.py", line 271, in init use_display_name) File "E:\models\research\object_detection\utils\label_map_util.py", line 152, in get_label_map_dict label_map = load_labelmap(label_map_path) File "E:\models\research\object_detection\utils\label_map_util.py", line 132, in load_labelmap label_map_string = fid.read() File "E:\Python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 120, in read self._preread_check() File "E:\Python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 80, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "E:\Python36\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 516, in exit c_api.TF_GetCode(self.status.status)) accoon\labelmap.pbtxt : \udcceļ\udcfe\udcc3\udcfb\udca1\udca2Ŀ¼\udcc3\udcfb\udcbb\udcf2\udcbe\udced\udcb1\udcea\udcd3﷨\udcb2\udcbb\udcd5\udcfdȷ\udca1\udca3 ; Unknown error

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. train.py

import functools import json import os import tensorflow as tf

from object_detection.legacy import trainer from object_detection.builders import dataset_builder from object_detection.builders import graph_rewriter_builder from object_detection.builders import model_builder from object_detection.utils import config_util from object_detection.utils import dataset_util

tf.logging.set_verbosity(tf.logging.INFO)

flags = tf.app.flags flags.DEFINE_string('master', '', 'Name of the TensorFlow master to use.') flags.DEFINE_integer('task', 0, 'task id') flags.DEFINE_integer('num_clones', 1, 'Number of clones to deploy per worker.') flags.DEFINE_boolean('clone_on_cpu', False, 'Force clones to be deployed on CPU. Note that even if ' 'set to False (allowing ops to run on gpu), some ops may ' 'still be run on the CPU if they have no GPU kernel.') flags.DEFINE_integer('worker_replicas', 1, 'Number of worker+trainer ' 'replicas.') flags.DEFINE_integer('ps_tasks', 0, 'Number of parameter server tasks. If None, does not use ' 'a parameter server.') flags.DEFINE_string('train_dir', '', 'Directory to save the checkpoints and training summaries.')

flags.DEFINE_string('pipeline_config_path', '', 'Path to a pipeline_pb2.TrainEvalPipelineConfig config ' 'file. If provided, other configs are ignored')

flags.DEFINE_string('train_config_path', '', 'Path to a train_pb2.TrainConfig config file.') flags.DEFINE_string('input_config_path', '', 'Path to an input_reader_pb2.InputReader config file.') flags.DEFINE_string('model_config_path', '', 'Path to a model_pb2.DetectionModel config file.')

FLAGS = flags.FLAGS

def main(_): assert FLAGS.train_dir, 'train_dir is missing.' if FLAGS.task == 0: tf.gfile.MakeDirs(FLAGS.train_dir) if FLAGS.pipeline_config_path: configs = config_util.get_configs_from_pipeline_file( FLAGS.pipeline_config_path) if FLAGS.task == 0: tf.gfile.Copy(FLAGS.pipeline_config_path, os.path.join(FLAGS.train_dir, 'pipeline.config'), overwrite=True) else: configs = config_util.get_configs_from_multiple_files( model_config_path=FLAGS.model_config_path, train_config_path=FLAGS.train_config_path, train_input_config_path=FLAGS.input_config_path) if FLAGS.task == 0: for name, config in [('model.config', FLAGS.model_config_path), ('train.config', FLAGS.train_config_path), ('input.config', FLAGS.input_config_path)]: tf.gfile.Copy(config, os.path.join(FLAGS.train_dir, name), overwrite=True)

model_config = configs['model'] print("model_config:") print(model_config) train_config = configs['train_config'] print("train_config") print(train_config) input_config = configs['train_input_config'] print("input_config") print(input_config)

model_fn = functools.partial( model_builder.build, model_config=model_config, is_training=True) print("yunxing")# def get_next(config): return dataset_util.make_initializable_iterator( dataset_builder.build(config)).get_next()

create_input_dict_fn = functools.partial(get_next, input_config)

env = json.loads(os.environ.get('TF_CONFIG', '{}')) cluster_data = env.get('cluster', None) cluster = tf.train.ClusterSpec(cluster_data) if cluster_data else None task_data = env.get('task', None) or {'type': 'master', 'index': 0} task_info = type('TaskSpec', (object,), task_data)

Parameters for a single worker.

ps_tasks = 0 worker_replicas = 1 worker_job_name = 'lonely_worker' task = 0 is_chief = True master = ''

if cluster_data and 'worker' in cluster_data: # Number of total worker replicas include "worker"s and the "master". worker_replicas = len(cluster_data['worker']) + 1 if cluster_data and 'ps' in cluster_data: ps_tasks = len(cluster_data['ps'])

if worker_replicas > 1 and ps_tasks < 1: raise ValueError('At least 1 ps task is needed for distributed training.')

if worker_replicas >= 1 and ps_tasks > 0: # Set up distributed training. server = tf.train.Server(tf.train.ClusterSpec(cluster), protocol='grpc', job_name=task_info.type, task_index=task_info.index) if task_info.type == 'ps': server.join() return

worker_job_name = '%s/task:%d' % (task_info.type, task_info.index)
task = task_info.index
is_chief = (task_info.type == 'master')
master = server.target

graph_rewriter_fn = None if 'graph_rewriter_config' in configs: graph_rewriter_fn = graph_rewriter_builder.build( configs['graph_rewriter_config'], is_training=True)

trainer.train( create_input_dict_fn, model_fn, train_config, master, task, FLAGS.num_clones, worker_replicas, FLAGS.clone_on_cpu, ps_tasks, worker_job_name, is_chief, FLAGS.train_dir, graph_hook_fn=graph_rewriter_fn)

if name == 'main': tf.app.run()

part of reccoon.config train_input_reader: { tf_record_input_reader { input_path: 'E:\raccoon\data\train.record' } label_map_path: 'E:\raccoon\labelmap.pbtxt' }

eval_config: { num_examples: 40

Note: The below line limits the evaluation process to 10 evaluations.

Remove the below line to evaluate indefinitely.

metrics_set:"pascal_voc_metrics" max_evals: 10 }

eval_input_reader: { tf_record_input_reader { input_path: 'E:\raccoon\data\val.record' } label_map_path: 'E:\raccoon\labelmap.pbtxt' shuffle: false num_readers: 1 }

Distance789 avatar Aug 02 '18 08:08 Distance789