"None Annotations" when running python download_and_convert_data.py
See original GitHub issueI extracted the coco files and annotations in data/coco in the following manner:
Running from FastMaskRCNN
ls data/coco
shows:
annotations test2014 test2015 train2014 val2014
I merged all annotations into one folder
Running from FastMaskRCNN:
python download_and_convert_data.py
delivers:
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally
loading annotations into memory...
Done (t=12.21s)
creating index...
index created!
train2014 has 82783 images
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties:
name: GeForce GT 730
major: 3 minor: 5 memoryClockRate (GHz) 0.9015
pciBusID 0000:01:00.0
Total memory: 1.95GiB
Free memory: 1.44GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GT 730, pci bus id: 0000:01:00.0)
>> Converting image 1/82783 shard 0
>> Converting image 2/82783 shard 0
>> Converting image 3/82783 shard 0
>> Converting image 4/82783 shard 0
>> Converting image 5/82783 shard 0
>> Converting image 6/82783 shard 0
>> Converting image 7/82783 shard 0
>> Converting image 8/82783 shard 0
>> Converting image 9/82783 shard 0
>> Converting image 10/82783 shard 0
>> Converting image 11/82783 shard 0
>> Converting image 12/82783 shard 0
>> Converting image 13/82783 shard 0
>> Converting image 14/82783 shard 0
>> Converting image 15/82783 shard 0
>> Converting image 16/82783 shard 0
>> Converting image 17/82783 shard 0
>> Converting image 18/82783 shard 0
>> Converting image 19/82783 shard 0
>> Converting image 20/82783 shard 0
>> Converting image 21/82783 shard 0
>> Converting image 22/82783 shard 0
>> Converting image 23/82783 shard 0
>> Converting image 24/82783 shard 0
>> Converting image 25/82783 shard 0
>> Converting image 26/82783 shard 0
>> Converting image 27/82783 shard 0
>> Converting image 28/82783 shard 0
>> Converting image 29/82783 shard 0
>> Converting image 30/82783 shard 0
None Annotations data/coco/train2014/COCO_train2014_000000262184.jpg
Traceback (most recent call last):
File "download_and_convert_data.py", line 35, in <module>
tf.app.run()
File "/home/schaal/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "download_and_convert_data.py", line 29, in main
download_and_convert_coco.run(FLAGS.dataset_dir2)
File "/home/schaal/Tensorflow/gits/FastMaskRCNN_org/libs/datasets/download_and_convert_coco.py", line 330, in run
'train2014')
File "/home/schaal/Tensorflow/gits/FastMaskRCNN_org/libs/datasets/download_and_convert_coco.py", line 290, in _add_to_tfrecord
gt_boxes, masks, mask = _get_coco_masks(coco, img_id, height, width, img_name)
File "/home/schaal/Tensorflow/gits/FastMaskRCNN_org/libs/datasets/download_and_convert_coco.py", line 221, in _get_coco_masks
LOG('None Annotations %s' % img_name)
File "/home/schaal/Tensorflow/gits/FastMaskRCNN_org/libs/logs/log.py", line 11, in LOG
datefmt='%m/%d/%Y %I:%M:%S %p', format='%(asctime)s %(message)s')
File "/usr/lib/python2.7/logging/__init__.py", line 1547, in basicConfig
hdlr = FileHandler(filename, mode)
File "/usr/lib/python2.7/logging/__init__.py", line 913, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib/python2.7/logging/__init__.py", line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: '/home/schaal/Tensorflow/gits/FastMaskRCNN_org/train/maskrcnn/maskrcnn.log'
Are you suspecting some issues with the download of the coco zip files?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Annotations Best Practices — Python 3.11.1 documentation
After running this code, ann should be either a dictionary or None . You're encouraged to double-check the type of ann using isinstance()...
Read more >None vs NoneType for type annotation - python - Stack Overflow
In Python 3.10, int | None is the way to describe a return type that could possibly be None . However, for Python...
Read more >Understanding type annotation in Python - LogRocket Blog
In this extensive post with specific examples, learn how to use Python type annotation to your advantage using the mypy library.
Read more >Python Type Checking (Guide) - Real Python
Type annotations and type hints; Adding static types to code, ... 1# play.py 2 3def play(player_name: str) -> None: 4 print(f"{player_name} plays") 5 ......
Read more >Type annotation in sublime.py and sublime_plugin.py #5418
Union[A, B] can only be replaced by A | B as of Python 3.10 (this is fine in stubs but not in codes...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ZheC @sebaschaal I solved this problem by creating the directory train/maskrnn in /your/path/FastMaskRCNN. The program doesn’t create this directory automatically.
Both works, thank you @lihungchieh @wuzheng-sjtu