예제 #1
0
    def make_dataloader(self, batch_size, shuffle, drop_last, nr_workers):
        from jactorch.data.dataloader import JacDataLoader
        from jactorch.data.collate import VarLengthCollateV2

        collate_guide = {
            "scene": "skip",
            "objects_raw": "skip",
            "objects": "concat",
            "image_index": "skip",
            "image_filename": "skip",
            "program_raw": "skip",
            "program_seq": "skip",
            "program_tree": "skip",
            "program_qsseq": "skip",
            "program_qstree": "skip",
            "question_type": "skip",
            "answer": "skip",
        }

        gdef.update_collate_guide(collate_guide)

        return JacDataLoader(
            self,
            batch_size=batch_size,
            shuffle=shuffle,
            drop_last=drop_last,
            num_workers=nr_workers,
            pin_memory=True,
            collate_fn=VarLengthCollateV2(collate_guide),
        )
예제 #2
0
    def make_dataloader(self, batch_size, shuffle, drop_last, nr_workers):
        from jactorch.data.dataloader import JacDataLoader
        from jactorch.data.collate import VarLengthCollateV2

        collate_guide = {
            'scene': 'skip',
            'objects_raw': 'skip',
            'objects': 'concat',

            'image_index': 'skip',
            'image_filename': 'skip',

            'program_raw': 'skip',
            'program_seq': 'skip',
            'program_tree': 'skip',
            'program_qsseq': 'skip',
            'program_qstree': 'skip',

            'question_type': 'skip',
            'answer': 'skip',
        }

        gdef.update_collate_guide(collate_guide)

        return JacDataLoader(
            self, batch_size=batch_size, shuffle=shuffle, drop_last=drop_last,
            num_workers=nr_workers, pin_memory=True,
            collate_fn=VarLengthCollateV2(collate_guide)
        )