Skip to content

Commit

Permalink
Fixed tensorflow/models#4780 and other python 3 incompatibilities
Browse files Browse the repository at this point in the history
  • Loading branch information
apacha committed Nov 12, 2018
1 parent 2652200 commit 34a5d04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion research/object_detection/model_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def tpu_scaffold():

# Eval metrics on a single example.
eval_metric_ops = eval_util.get_eval_metric_ops_for_evaluators(
eval_config, category_index.values(), eval_dict)
eval_config, list(category_index.values()), eval_dict)
for loss_key, loss_tensor in iter(losses_dict.items()):
eval_metric_ops[loss_key] = tf.metrics.mean(loss_tensor)
for var in optimizer_summary_vars:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def evaluate(self):
if idx + self._label_id_offset in category_index:
category_name = category_index[idx + self._label_id_offset]['name']
try:
category_name = unicode(category_name, 'utf-8')
category_name = str(category_name, 'utf-8')
except TypeError:
pass
category_name = unicodedata.normalize(
Expand Down Expand Up @@ -795,8 +795,7 @@ def add_single_detected_image_info(self, image_key, detected_boxes,
if scores[i].shape[0] > 0:
self.scores_per_class[i].append(scores[i])
self.tp_fp_labels_per_class[i].append(tp_fp_labels[i])
(self.num_images_correctly_detected_per_class
) += is_class_correctly_detected_in_image
self.num_images_correctly_detected_per_class += is_class_correctly_detected_in_image

def _update_ground_truth_statistics(self, groundtruth_class_labels,
groundtruth_is_difficult_list,
Expand Down

0 comments on commit 34a5d04

Please sign in to comment.