Skip to content

Question about splitting batches in 'dp' mode #5192

@xiaopi-ouo

Description

@xiaopi-ouo

Hello, I faced the same problem as mentioned as #1508.

    def collate_fn(self, samples):
        output = {}

        output['labels'] = [sample['labels'] for sample in samples]

Here the the samples is a list of tensor with different size.
It's unavoidable in my case. (each sample actually has different number of parts to be predicted)
So, I can't solved it by just converting them into a tensor torch.tensor([sample['labels'] for sample in samples])
Is there other solution?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions