Commit 35176131 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower Committed by TF Object Detection Team
Browse files

Improved error message by indicating detected tf version, for easier...

Improved error message by indicating detected tf version, for easier debugging. Eg, now reads "ValueError: hourglass_20 is not supported for tf version 1. See `model_builder.py` for features extractors compatible with different versions of Tensorflow".

Before, the message was confusing because it might've indicated hourglass_20 was not supported (but it is... just not for tf version 1).

PiperOrigin-RevId: 438053726
parent 0f68d7d1
......@@ -263,9 +263,11 @@ if tf_version.is_tf1():
def _check_feature_extractor_exists(feature_extractor_type):
feature_extractors = set().union(*FEATURE_EXTRACTOR_MAPS)
if feature_extractor_type not in feature_extractors:
raise ValueError('{} is not supported. See `model_builder.py` for features '
'extractors compatible with different versions of '
'Tensorflow'.format(feature_extractor_type))
tf_version_str = '2' if tf_version.is_tf2() else '1'
raise ValueError(
'{} is not supported for tf version {}. See `model_builder.py` for '
'features extractors compatible with different versions of '
'Tensorflow'.format(feature_extractor_type, tf_version_str))
def _build_ssd_feature_extractor(feature_extractor_config,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment