tensorflow / tensorflow/models

Tensorflow 2 Object Detection API: Error loading TFRecord images (coco)

Open
#9,154 1 comment 0 reactions 3 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm trying to run object detection model from one of the config files

ssd_mobilenet_v2_320x320_coco17_tpu-8.config

Coco dataset is downloaded from tensorflow-dataset api
https://github.com/tensorflow/datasets

which is bunch of tfrecord files.

when running below command,

PIPELINE_CONFIG_PATH=./ssd_mobilenet_v2_320x320_coco17_tpu-8.config
MODEL_DIR=checkpoints
python object_detection/model_main_tf2.py \
    --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
    --model_dir=${MODEL_DIR} \
    --alsologtostderr

I got the error in loading tfrecord files (saying can not decode file)

tensorflow.python.framework.errors_impl.InvalidArgumentError: 4 root error(s) found.
  (0) Invalid argument:  assertion failed: [Unable to decode bytes as JPEG, PNG, GIF, or BMP]
         [[{{node case/cond/else/_10/case/cond/cond_jpeg/else/_105/case/cond/cond_jpeg/decode_image/cond_jpeg/else/_121/case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/else/_140/case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/cond_gif/else/_159/case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/cond_gif/Assert/Assert}}]]
         [[MultiDeviceIteratorGetNextFromShard]]
         [[RemoteCall]]
         [[IteratorGetNext_1]]
         [[Func/replica_2/Loss/classification_loss_1/write_summary/summary_cond/then/_110/input/_413/_7548]]
  (1) Invalid argument:  assertion failed: [Unable to decode bytes as JPEG, PNG, GIF, or BMP]
         [[{{node case/cond/else/_10/case/cond/cond_jpeg/else/_105/case/cond/cond_jpeg/decode_image/cond_jpeg/else/_121/case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/else/_140/case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/cond_gif/else/_159/case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/cond_gif/Assert/Assert}}]]
         [[MultiDeviceIteratorGetNextFromShard]]
         [[RemoteCall]]
         [[IteratorGetNext_1]]
  (2) Cancelled:  Function was cancelled before it was started
  (3) Invalid argument:  assertion failed: [Unable to decode bytes as JPEG, PNG, GIF, or BMP]
         [[{{node case/cond/else/_10/case/cond/cond_jpeg/else/_105/case/cond/cond_jpeg/decode_image/cond_jpeg/else/_121/case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/else/_140/case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/cond_gif/else/_159/case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/cond_gif/Assert/Assert}}]]
         [[MultiDeviceIteratorGetNextFromShard]]
         [[RemoteCall]]
         [[IteratorGetNext_1]]
         [[loss_shape_1_198795/_2]]
0 successful operations.
1 derived errors ignored. [Op:__inference__dist_train_step_369044]

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.