Torchloader: why I delete some prepocessing transforms then code can't work?

As title said my transform list is as following

transforms_list += [
            random_flip,
            random_resize,
            random_crop,
            filter_hv,
            anchor_target,
                   ]

and anchor_target is a assign function and I want to delete it such as

transforms_list += [
            random_flip,
            random_resize,
            random_crop,
            filter_hv,
            #anchor_target,
                   ]

Of course I define my own collate_fn and the return is a dict. And when I set num_workers=0 code works fine, but one I set num_workers>0. It will cause error that

dataloader worker pid …, …exited unexpectedly

that’s really weird.

PS: the return dict’s key is string, it’s value has np.ndarray, string, bool types. Do I return some wrong type in collate_fn?