Giter Club home page Giter Club logo

Comments (6)

VincentStimper avatar VincentStimper commented on July 24, 2024

Hi @gianmarcoaversanoenx,

I tried to reproduce the error you are describing, but for me saving and loading of models with MADE nets works fine with model.save and model.load no matter if preprocessing is a lambda function or not.
Can you provide a code snippet to reproduce this error, please?

Best regards,
Vincent

from normalizing-flows.

gianmarcoaversanoenx avatar gianmarcoaversanoenx commented on July 24, 2024
n_flos: int
dim: int
n_layers: int
hidden_units: int
for _ in range(n_flows):
                flows += [
                    normflows.flows.AutoregressiveRationalQuadraticSpline(
                        dim,
                        n_layers,
                        hidden_units,
                    )
                ]
                flows += [normflows.flows.LULinearPermute(dim)]
# Set base distribution
base = normflows.distributions.DiagGaussian(dim, trainable=False)
# Build flow model
nf = normflows.NormalizingFlow(base, flows)

# Save
torch.save(nf, 'model.ckpt`)

This would give me: Can't pickle MADE.<local>(lambda)...

from normalizing-flows.

VincentStimper avatar VincentStimper commented on July 24, 2024

Hi @gianmarcoaversanoenx,

thanks, I could reproduce the error now and replaced the lambda functions with something that can be pickled. Feel free to try it out yourself by installing the package from the current master branch.

Best regards,
Vincent

from normalizing-flows.

gianmarcoaversanoenx avatar gianmarcoaversanoenx commented on July 24, 2024

Thanks! :) Is this going to be pushed to PyPI, too?

from normalizing-flows.

VincentStimper avatar VincentStimper commented on July 24, 2024

Hi @gianmarcoaversanoenx,

sure, I will do so in about 1-2 weeks.

Best regards,
Vincent

from normalizing-flows.

VincentStimper avatar VincentStimper commented on July 24, 2024

I just released a new version of the package on PyPI. Hence, I'll close this issue.

from normalizing-flows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.