Yes, the type of the coco caption is unicode (not string) so that this problem is caused. [torch.utils.data.CocoCaptions] (https://github.com/pytorch/vision/blob/master/torchvision/datasets/coco.py#L20 3) returns img and target. target is an unicode object.
I solved this problem by converting return type unicode to string.
There is two possible options to handle this problem.
i) Add the code in torch.utils.data.CocoCaptions to return target as a string type.
ii) Add the code in default_collater to handle the case of unicode object (The problem now is the function considers unicode as collections.Iterable 2).
Could i pull request to solve this problem?