models icon indicating copy to clipboard operation
models copied to clipboard

Oxford-IIIT Pet TFRecord file generation

Open frankist opened this issue 9 years ago • 6 comments

System information

  • environment capture script output:
== cat /etc/issue ===============================================
Linux xico-dell-linux 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
VERSION="16.04.3 LTS (Xenial Xerus)"
VERSION_ID="16.04"
VERSION_CODENAME=xenial

== are we in docker =============================================
No

== compiler =====================================================
c++ (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


== uname -a =====================================================
Linux xico-dell-linux 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

== check pips ===================================================
numpy (1.13.3)
protobuf (3.4.0)
tensorflow (1.4.0)
tensorflow-tensorboard (0.4.0rc3)

== check for virtualenv =========================================
False

== tensorflow import ============================================
tf.VERSION = 1.4.0
tf.GIT_VERSION = v1.4.0-rc1-11-g130a514
tf.COMPILER_VERSION = v1.4.0-rc1-11-g130a514
Sanity check: array([1], dtype=int32)

== env ==========================================================
LD_LIBRARY_PATH is unset
DYLD_LIBRARY_PATH is unset

== nvidia-smi ===================================================
./tf_env_collect.sh: line 106: nvidia-smi: command not found

== cuda libs  ===================================================
/usr/local/MATLAB/R2017a/bin/glnxa64/libcudart.so.8.0.44
  • tensorflow version: ('v1.4.0-rc1-11-g130a514', '1.4.0')
  • command to reproduce: from the models/research directory run: python object_detection/create_pet_tf_record.py --label_map_path=object_detection/data/pet_label_map.pbtxt --data_dir=pwd --output_dir=pwd``
  • not using any gpu
  • tensorflow was installed through pip
  • I am using linux ubuntu 16.04

Describe the problem

Hello all,

I was trying to follow the quick start tutorial (https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_pets.md) when I faced what I think is a documentation bug.

The tutorial asks to run the command from the models/research directory: python object_detection/create_pet_tf_record.py
--label_map_path=object_detection/data/pet_label_map.pbtxt
--data_dir=pwd
--output_dir=pwd

However, the script create_pet_tf_record.py is not in object_detection folder anymore, but in object_detection/dataset_tools. Furthermore, if I do not set the attribute "--faces_only=False", it will not generate the files pet_train.record and pet_val.record as suggested by the tutorial. Instead, it will create two empty files: pet_val_with_masks.record and pet_train_with_masks.record.

I inspected the code in create_pet_tf_record.py and there is no way the variable "masks" will arrive to the line 163 where "mast_stack" is set, without being empty if "faces_only" is not set to False. This leads to a deterministic fail to generate the record for all oxford images.

Thanks for the support. It is my first time using this tool, so I am not sure I configured something wrong.

Regards, Francisco

frankist avatar Nov 22 '17 11:11 frankist

I also meet the same issue, still on debugging.

vslm698 avatar Nov 23 '17 03:11 vslm698

same issue,haven't solved

ok,after spending a hole day,i have figured out:the code

if not faces_only: (Tab)mask_remapped = mask_np != 2 masks.append(mask_remapped) mask_stack = np.stack(masks).astype(np.float32)

should be changed to this :

if not faces_only: (Tab) mask_remapped = mask_np != 2 (Tab)masks.append(mask_remapped) (Tab)mask_stack = np.stack(masks).astype(np.float32) Tab means that the last two line of the code should be inside the 'if' condition then the pet_val_with_masks.record and pet_train_with_masks.record are not empty any more!

sunjinghua avatar Nov 23 '17 04:11 sunjinghua

they change the folder structure recently. maybe the document is not up to date now.

scotthuang1989 avatar Nov 23 '17 08:11 scotthuang1989

I also meet the same issue

RippleZou avatar Nov 24 '17 04:11 RippleZou

@tombstone Looks like you moved create_pet_tf_record.py with 6f4dff46a40e73de03dc4a7fe87363956bb76522, can you take a look at this?

tatatodd avatar Nov 29 '17 01:11 tatatodd

Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

tensorflowbutler avatar Jan 29 '20 23:01 tensorflowbutler