tensorflow / tensorflow/models

TF_Record from COCO 2014 makes Windows fatal exception errors

Open
#7,242 2 comments 1 reaction 3 assignees View on GitHub

@pkulzc is already working on this.

Since Jun 23, 2020.

models:research:odapi
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\create_coco_tf_record.py

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Just ran create_coco_tf_record on COCO 2014,

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): WINDOWS 10 Edu

  • TensorFlow installed from (source or binary): pip, tensorflow-gpu

  • TensorFlow version (use command below): 1.14.0

  • Bazel version (if compiling from source):

  • CUDA/cuDNN version: CUDA 10.0, cuDNN 7.6.1

  • GPU model and memory: Nvidia 2080 Ti, 11GB

  • Exact command to reproduce:
    python D:/Github/models/research/object_detection/dataset_tools/create_coco_tf_record.py ^
    --logtostderr ^
    --include_masks ^
    --train_image_dir="C:/Data/COCO/train2014" ^
    --train_annotations_file="C:/Data/COCO/annotations/instances_train2014.json" ^
    --val_image_dir="C:/Data/COCO/val2014" ^
    --test_image_dir="C:/Data/COCO/val2014" ^
    --val_annotations_file="C:/Data/COCO/annotations/instances_valminusminival2014.json" ^
    --testdev_annotations_file="C:/Data/COCO/annotations\instances_minival2014.json" ^
    --output_dir="D:/Data/COCO"

on CMD.
(trying only train or minival dataset still gives this error)

Describe the problem

After running script, Windows fatal exception stops python and only gives empty TF_Records.
"C:\Python37\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 84 in _preread_check is the cause of errors.
But when I tried to preprocess COCO 2017(by "running download_and_preprocess_mscoco.sh"), it worked well and finished. I didn't try custom datasets, but I hardly think there won't be problems...

Also, scripts or documentation converting COCO 2014(with minival, val-minival) to TF_Record should be added. "download_and_preprocess_mscoco.sh" only makes train, val TF_Record with annotations.

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

D:/Github/models/research/object_detection/dataset_tools/create_coco_tf_record.py ^
More? --logtostderr ^
More? --include_masks ^
More? --train_image_dir="C:/Data/COCO/train2014" ^
More? --train_annotations_file="C:/Data/COCO/annotations/instances_train2014.json" ^
More? --val_image_dir="C:/Data/COCO/val2014" ^
More? --test_image_dir="C:/Data/COCO/val2014" ^
More? --val_annotations_file="C:/Data/COCO/annotations/instances_valminusminival2014.json" ^
More? --testdev_annotations_file="C:/Data/COCO/annotations\instances_minival2014.json" ^
More? --output_dir="D:/Data/COCO"
I0718 06:51:08.916676 4244 create_coco_tf_record.py:218] Found groundtruth annotations. Building annotations index.
I0718 06:51:09.182965 4244 create_coco_tf_record.py:231] 702 images are missing annotations.
I0718 06:51:09.182965 4244 create_coco_tf_record.py:236] On image 0 of 82783
Windows fatal exception: access violation

Current thread 0x00001094 (most recent call first):
File "C:\Python37\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 84 in _preread_check
File "C:\Python37\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 122 in read
File "D:/Github/models/research/object_detection/dataset_tools/create_coco_tf_record.py", line 114 in create_tf_example
File "D:/Github/models/research/object_detection/dataset_tools/create_coco_tf_record.py", line 239 in _create_tf_record_from_coco_annotations
File "D:/Github/models/research/object_detection/dataset_tools/create_coco_tf_record.py", line 266 in main
File "C:\Python37\lib\site-packages\absl\app.py", line 251 in _run_main
File "C:\Python37\lib\site-packages\absl\app.py", line 300 in run
File "C:\Python37\lib\site-packages\tensorflow\python\platform\app.py", line 40 in run
File "D:/Github/models/research/object_detection/dataset_tools/create_coco_tf_record.py", line 282 in

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.