gentle-scientist-22504
09/18/2024, 3:30 PM-> tuple[pytorch class, pytrorch class]
but I get error:
Failed to convert type <class 'torch.utils.data.dataloader.DataLoader'> to type <class
'torch.utils.data.dataloader.DataLoader'>.
Error Message: ctypes objects containing pointers cannot be pickled.
high-park-82026
freezing-airport-6809
type
of data. The type
is used to invoke the right TypeTransformer
. Incase Flytekit does not find a pre-registered transformer for a type, it resolves to using pickle.
Your error says - that tye type DataLoader cannot be pickled. and this was because there is no inbuilt transformer.
Solution you can implement a transformer for yourself. Reason to implement a custom one, is dataloaders can be completely data dependent, distributed etc. Hard to implement a common transformer.
Example for nn.module
https://github.com/flyteorg/flytekit/blob/fb55841f8660b2a31e99381dd06e42f8cd22758e/flytekit/extras/pytorch/native.py#L31gentle-scientist-22504
09/18/2024, 9:12 PM