tensorflow / tensorflow/models

Cannot use native ssd keras featurer extractor

Open
#7,377 8 comments 1 reaction 3 assignees View on GitHub

@pkulzc is already working on this.

Since Jun 24, 2020.

models:research:odapi type:support
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

Hello everyone.
I trained MobileNet-v1 SSD object detector using coco pretrained checkpoint as described in every tutorial - it's Ok. Then I just changed ssd_mobilenet_v1 with ssd_mobilenet_v1_keras in pipeline config file and receive the following error:

Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/vasiliy/Projects/models/research/object_detection/model_main.py", line 111, in
tf.app.run()
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "/home/vasiliy/Projects/models/research/object_detection/model_main.py", line 107, in main
tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 471, in train_and_evaluate
return executor.run()
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 611, in run
return self.run_local()
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 712, in run_local
saving_listeners=saving_listeners)
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 358, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1124, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1154, in _train_model_default
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1112, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/home/vasiliy/Projects/models/research/object_detection/model_lib.py", line 302, in model_fn
features[fields.InputDataFields.true_image_shape])
File "/home/vasiliy/Projects/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 581, in predict
predictor_results_dict = self._box_predictor(feature_maps)
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 538, in call
self._maybe_build(inputs)
File "/home/vasiliy/Projects/venv/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1603, in _maybe_build
self.build(input_shapes)
File "/home/vasiliy/Projects/models/research/object_detection/predictors/convolutional_keras_box_predictor.py", line 136, in build
if len(input_shapes) != len(self._prediction_heads[BOX_ENCODINGS]):
TypeError: object of type 'NoneType' has no len()

No other changes were done.

System information:
What is the top-level directory of the model you are using: N/A
Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Not yet. Just want to know how to.
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
TensorFlow installed from (source or binary): binary (via pip)
TensorFlow version (use command below): tensorflow-gpu==1.13.1
Bazel version (if compiling from source): N/A
CUDA/cuDNN version: 10.0.130
GPU model and memory: GeForce GTX 1080 8116MiB
Exact command to reproduce: N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.