tensorflow / tensorflow/models

[object_detection] Unit tests failing for /dataset_tools/oid_tfrecord_creation.py

Open
#7,997 2 comments 0 reactions 3 assignees View on GitHub

@pkulzc is already working on this.

Since May 29, 2020.

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

Description

System information
  • What is the top-level directory of the model you are using: /models/research/object_detection/dataset_tools
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Scientific Linux 7.6 (Nitrogen)
  • TensorFlow installed from (source or binary): binary (tensorflow-1.15.0-cp37-cp37m-manylinux2)
  • TensorFlow version (use command below): 1.15.0
  • Bazel version (if compiling from source): NA
  • CUDA/cuDNN version: NA
  • GPU model and memory: NA
  • Exact command to reproduce: python /object_detection/dataset_tools/oid_tfrecord_creation_test.py
    (from within /models/research)
Describe the problem

Unit tests are failing for /object_detection/dataset_tools/oid_tfrecord_creation.py . I also encounter the the same error again originating from oid_tfrecord_creation when trying to run /object_detection/dataset_tools/create_oid_tf_record.py with the label map /object_detection/data/oid_v4_label_map.pbtxt .

Source code / logs
Running tests under Python 3.7.5: /afs/inf.ed.ac.uk/user/s16/s1614973/miniconda3/envs/hp/bin/python
[ RUN      ] TfExampleFromAnnotationsDataFrameTests.test_label_filtering
/dev/shm/models/research/object_detection/dataset_tools/oid_tfrecord_creation.py:53: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
  filtered_data_frame_boxes.YMin.as_matrix()),
/dev/shm/models/research/object_detection/dataset_tools/oid_tfrecord_creation.py:56: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
  filtered_data_frame_boxes.XMin.as_matrix()),
/dev/shm/models/research/object_detection/dataset_tools/oid_tfrecord_creation.py:59: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
  filtered_data_frame_boxes.YMax.as_matrix()),
/dev/shm/models/research/object_detection/dataset_tools/oid_tfrecord_creation.py:62: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
  filtered_data_frame_boxes.XMax.as_matrix()),
/dev/shm/models/research/object_detection/dataset_tools/oid_tfrecord_creation.py:65: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
  filtered_data_frame_boxes.LabelName.as_matrix()),
[  FAILED  ] TfExampleFromAnnotationsDataFrameTests.test_label_filtering
[ RUN      ] TfExampleFromAnnotationsDataFrameTests.test_no_attributes
[  FAILED  ] TfExampleFromAnnotationsDataFrameTests.test_no_attributes
[ RUN      ] TfExampleFromAnnotationsDataFrameTests.test_session
[  SKIPPED ] TfExampleFromAnnotationsDataFrameTests.test_session
[ RUN      ] TfExampleFromAnnotationsDataFrameTests.test_simple
[  FAILED  ] TfExampleFromAnnotationsDataFrameTests.test_simple
======================================================================
ERROR: test_label_filtering (__main__.TfExampleFromAnnotationsDataFrameTests)
test_label_filtering (__main__.TfExampleFromAnnotationsDataFrameTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "object_detection/dataset_tools/oid_tfrecord_creation_test.py", line 147, in test_label_filtering
    df[df.ImageID == 'i1'], label_map, 'encoded_image_test')
  File "/dev/shm/models/research/object_detection/dataset_tools/oid_tfrecord_creation.py", line 65, in tf_example_from_annotations_data_frame
    filtered_data_frame_boxes.LabelName.as_matrix()),
  File "/dev/shm/models/research/object_detection/utils/dataset_util.py", line 38, in bytes_list_feature
    return tf.train.Feature(bytes_list=tf.train.BytesList(value=value))
TypeError: 'a' has type str, but expected one of: bytes

======================================================================
ERROR: test_no_attributes (__main__.TfExampleFromAnnotationsDataFrameTests)
test_no_attributes (__main__.TfExampleFromAnnotationsDataFrameTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "object_detection/dataset_tools/oid_tfrecord_creation_test.py", line 109, in test_no_attributes
    df[df.ImageID == 'i2'], label_map, 'encoded_image_test')
  File "/dev/shm/models/research/object_detection/dataset_tools/oid_tfrecord_creation.py", line 65, in tf_example_from_annotations_data_frame
    filtered_data_frame_boxes.LabelName.as_matrix()),
  File "/dev/shm/models/research/object_detection/utils/dataset_util.py", line 38, in bytes_list_feature
    return tf.train.Feature(bytes_list=tf.train.BytesList(value=value))
TypeError: 'b' has type str, but expected one of: bytes

======================================================================
ERROR: test_simple (__main__.TfExampleFromAnnotationsDataFrameTests)
test_simple (__main__.TfExampleFromAnnotationsDataFrameTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "object_detection/dataset_tools/oid_tfrecord_creation_test.py", line 48, in test_simple
    df[df.ImageID == 'i1'], label_map, 'encoded_image_test')
  File "/dev/shm/models/research/object_detection/dataset_tools/oid_tfrecord_creation.py", line 65, in tf_example_from_annotations_data_frame
    filtered_data_frame_boxes.LabelName.as_matrix()),
  File "/dev/shm/models/research/object_detection/utils/dataset_util.py", line 38, in bytes_list_feature
    return tf.train.Feature(bytes_list=tf.train.BytesList(value=value))
TypeError: 'a' has type str, but expected one of: bytes

----------------------------------------------------------------------
Ran 4 tests in 0.034s

FAILED (errors=3, skipped=1)

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.