create_pet_tf_record.py is broken
create_pet_tf_record.py does not work anymore the flag faces_only=True does not work
There is an import error and even if I fix that, all the images are ignored: WARNING:root:Invalid example: annotations/xmls/great_pyrenees_15.xml, ignoring.
the bug should be here: mask_stack = np.stack(masks).astype(np.float32)
Same issue, create_pet_tf_record.py ignores all xml files inside annotation folder and creates 2 empty pet_train_with_masks.record and pet_val_with_masks.record files.
command: python object_detection/dataset_tools/create_pet_tf_record.py --label_map_path=object_detection/data/pet_label_map.pbtxt --data_dir='pwd' --output_dir='pwd'
Output: WARNING:root:Invalid example: annotations/xmls/great_pyrenees_177.xml, ignoring.
Pls help fixing this issue.
I also have this issue.
Following instructions and end with WARNING:root:Invalid example: *.xml, ignoring.
Resulting files pet_val_with_masks.record and pet_train_with_masks.record has 0 bytes size.
@nealwu are you familiar with this? Who maintains this?
You can fix this by changing the lines 160 in create_pet_tf_record.py from:
if not faces_only:
mask_remapped = mask_np != 2
masks.append(mask_remapped)
mask_stack = np.stack(masks).astype(np.float32)
masks_flattened = np.reshape(mask_stack, [-1])
to
if not faces_only:
mask_remapped = mask_np != 2
masks.append(mask_remapped)
if not faces_only:
mask_stack = np.stack(masks).astype(np.float32)
masks_flattened = np.reshape(mask_stack, [-1])
the mask stacking needs to be done outside the for loop and in an if statement
Thank you, look like it solve the problem.
After suggested update TFRecords are generated as expected.
same problem here and It is easy to spot and fix. I notice that there is no test case for create_pet_tf_record. Is it intentional? test case should be a good way to avoid this kind of problem.
Feel free to contribute a test case, that would be great.
On Sat, Dec 9, 2017, 5:08 AM scott huang(黄) [email protected] wrote:
same problem here and It is easy to spot and fix. I notice that there is no test case for create_pet_tf_record. Is it intentional? test case should be a good way to avoid this kind of problem.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/2958#issuecomment-350463518, or mute the thread https://github.com/notifications/unsubscribe-auth/AT_SbbENrscIAlEPOONkEuJb7ASiioLyks5s-oZGgaJpZM4Q1Hd4 .
Assigning @tombstone @jch1 for object_detection.
Does this issue solved? I still have this issue and all above tips do not work for me.
@Labyrins is there any reason you un-assigned @tombstone?
@nealwu I did not unassigned him. I just leaved my question. This issue system automatically unassigned him.
I am facing the same problem. Also these lines do not exist in create_pet_tf_record.py:
if not faces_only:
mask_remapped = mask_np != 2
masks.append(mask_remapped)
mask_stack = np.stack(masks).astype(np.float32)
masks_flattened = np.reshape(mask_stack, [-1])
same here @jashshopin did u solve your issue
Same issue here!
the problem is still there