I have custom classes HsImage(Image), HSImageItemList(ItemList) and HsDataBunch(ImageDataBunch). HSImageItemList has two custom keyword arguments ‘dims’ and ‘chans’ that handle whether to consider data as image data (2-dimensional) or volumetric(3-dimensional), and chans that defines which channels to use in classification.
HSImageItemList is initialized like
def __init__(self, items, dims, chans=list(range(461)), **kwargs): super().__init__(items, **kwargs) self.dims = dims self.chans = chans self.copy_new.append('dims') self.copy_new.append('chans')
After exporting a learner that uses these, load_learner fails with
TypeError: __init__() missing 1 required positional argument: 'dims'. How can I load this with same
dims that it was saved with?