tensorflow / tpu

Reference models and tools for Cloud TPUs.
https://cloud.google.com/tpu/
Apache License 2.0
5.21k stars 1.77k forks source link

Fashionpedia: Unclear how to train model #829

Open mauricelos opened 4 years ago

mauricelos commented 4 years ago

Hi, I'm currently trying to wrap my head around how to initiate training with the fashionpedia dataset. I was able to run the model using inference.py and pre trained weights, but training is a mystery to me. I looked at this GETTING STARTED and for training we need to provide tfrecord files, but the Fashionpedia dataset is using the Coco dataset format. How do I training a model on this dataset or how can I convert the fashionpedia dataset to tfrecords files?

Edit: I tried converting the fashionpedia dataset to tfrecords using a modified version of create_coco_tf_record.py, unfortunately this didn't work. I get this error at the moment:

(0) Invalid argument: {{function_node __inference_tf_data_experimental_map_and_batch_<class 'dataloader.data_parser.Parser'>_2225}} Input to reshape is a tensor with 13 values, but the requested shape requires a multiple of 294
         [[{{node parser/Reshape}}]]
         [[MultiDeviceIteratorGetNextFromShard]]
         [[RemoteCall]]
         [[IteratorGetNext]]
(1) Invalid argument: {{function_node __inference_tf_data_experimental_map_and_batch_<class 'dataloader.data_parser.Parser'>_2225}} Input to reshape is a tensor with 13 values, but the requested shape requires a multiple of 294
         [[{{node parser/Reshape}}]]
         [[MultiDeviceIteratorGetNextFromShard]]
         [[RemoteCall]]
         [[IteratorGetNext]]
         [[Mean_5/_12563]]

Which I suspect to be an issue with my tfrecord files, it's clearly expecting the shape of length of all the fashionpedia attributes, where as I probably only have the attributes found in one of the images. The structure of the input tfrecords remains unclear to me.

Thanks in advance!

mitraavi commented 4 years ago

@richardaecn kindly share following examples :

It will be very helpful for us to see as how we prepare data and train Attribute Mask RCNN network.

Thank You

22wei22 commented 4 years ago

@mitraavi @mauricelos I was Not able to run the model using inference.py https://github.com/tensorflow/tpu/tree/master/models/official/detection/projects/fashionpedia I cant import such as from utils import box_utils from utils import input_utils from utils import mask_utils from utils.object_detection import visualization_utils How do you inference?

mauricelos commented 3 years ago

@22wei22 and @SikandAlex Your problems with inference have nothing to do with the issue I'm reporting here. Please open a separate issue for yours.

hosnasattar commented 3 years ago

@mauricelos do you find out how to work around it? Also could you let me know how you run the inference code? I can see that this is not related to your post but the authors of the code are not responding at all so if you could support here?