Skip to content

Scattering2D torch can't be serialized #1057

Open
@jmaba

Description

@jmaba

It seems the Scattering2D from Torch can't be serialized. I need this because I create several Scattering2D with pretty big dimensions (images with shapes up to 4k) - which is a time consuming process. So I would like the opportunity to be able to serialize the created Scattering2D object (actually the coefficients) so that I can apply to my images.

Steps to reproduce:
import torch
from kymatio.torch import Scattering2D
import pickle
J = 3
M, N = 32, 32
file = open('serializeScattering2DObject', 'wb')
pickle.dump(S, file)

Expected results:
the serialization should be done.
Actual results:
Error is thrown - "_pickle.PicklingError: Can't pickle <class 'kymatio.torch.ScatteringTorch2D'>: attribute lookup ScatteringTorch2D on kymatio.torch failed"

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions