Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

MscocoObjectDetection does not work. #414

Closed
ytfksw opened this issue Sep 11, 2019 · 4 comments · Fixed by #494
Closed

MscocoObjectDetection does not work. #414

ytfksw opened this issue Sep 11, 2019 · 4 comments · Fixed by #494
Assignees

Comments

@ytfksw
Copy link
Contributor

ytfksw commented Sep 11, 2019

MscocoObjectDetection does not work. On the other hand, Similar dataloader MscocoObjectDetectionPerson works.
This is the trace back:

Traceback (most recent call last):
  File "executor/train.py", line 432, in <module>
    main()
  File "/storage/fukasawa/.pyenv/versions/benchmark_mscoco/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/storage/fukasawa/.pyenv/versions/benchmark_mscoco/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/storage/fukasawa/.pyenv/versions/benchmark_mscoco/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/storage/fukasawa/.pyenv/versions/benchmark_mscoco/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "executor/train.py", line 428, in main
    run(network, dataset, config_file, experiment_id, recreate)
  File "executor/train.py", line 393, in run
    start_training(config)
  File "executor/train.py", line 136, in start_training
    metrics_summary_op, metrics_placeholders = executor.prepare_metrics(metrics_ops_dict)
  File "/storage/fukasawa/tmp/blueoil_mscoco/lmnet/lmnet/utils/executor.py", line 121, in prepare_metrics
    tf.float32, name="{}_placeholder".format(metrics_key)
  File "/storage/fukasawa/.pyenv/versions/benchmark_mscoco/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 2077, in placeholder
    return gen_array_ops.placeholder(dtype=dtype, shape=shape, name=name)
  File "/storage/fukasawa/.pyenv/versions/benchmark_mscoco/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 5791, in placeholder
    "Placeholder", dtype=dtype, shape=shape, name=name)
  File "/storage/fukasawa/.pyenv/versions/benchmark_mscoco/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 394, in _apply_op_helper
    with g.as_default(), ops.name_scope(name) as scope:
  File "/storage/fukasawa/.pyenv/versions/benchmark_mscoco/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 6088, in __enter__
    return self._name_scope.__enter__()
  File "/storage/fukasawa/.pyenv/versions/3.6.4/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/storage/fukasawa/.pyenv/versions/benchmark_mscoco/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3989, in name_scope
    raise ValueError("'%s' is not a valid scope name" % name)
ValueError: 'AveragePrecision_0.5/traffic light_placeholder' is not a valid scope name

It seems that an error has occurred because there is a space in the class name such as ‘traffic light’. I think that it is necessary to add processing that replaces spaces with underscores or something.

@Joeper214 Joeper214 self-assigned this Sep 20, 2019
@Joeper214
Copy link
Contributor

@ytfksw Thanks for reporting this issue I'll fix this one.

@takecore
Copy link
Contributor

takecore commented Oct 3, 2019

@Joeper214
Copy link
Contributor

Joeper214 commented Oct 4, 2019

@takecore @ytfksw

this problem is
MSCOCO label name is not match tensorflow scope name require regular expressions, right?

https://github.com/tensorflow/tensorflow/blob/r1.2/tensorflow/python/framework/ops.py#L1150-L1151

https://stackoverflow.com/questions/44664285/what-are-the-constraints-for-tensorflow-scope-names?answertab=votes#answer-44664366

I found out it's not only related to how MSCOCO dataset is prepared.
It's related to how we generate the metrics of yolov2 and yolov1 metrics.

Which is related to this fixed line in the Segmentation base metrics.

class_name = class_name.replace(' ', '_')

@takecore
Copy link
Contributor

takecore commented Oct 4, 2019

@Joeper214
yes, It's related to that.
segmentation networks extends from network/segmentation/base.py,
but object_detection networks doesn't have base.py.

how about change network/base.py and normalize this string problem.
https://github.com/blue-oil/blueoil/blob/master/lmnet/lmnet/networks/base.py#L61

@tkng tkng closed this as completed in #494 Oct 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants