Coder Social home page Coder Social logo

Comments (4)

jonasrauber avatar jonasrauber commented on May 24, 2024

Thanks Ivan, we certainly need to improve the documentation.

Would you have expected a different syntax to specify a custom session? Maybe we can make it easier to use TensorFlowModel.

from foolbox.

ivust avatar ivust commented on May 24, 2024

Maybe there could be an optional argument for a user-defined session in the TensorFlowModel:

TensorFlowModel(images, logits, bounds, channel_axis=3, user_session=None)

If no session if provided, then TensorFlowModel can do what it does now, but maybe also throw a warning that a new session has been created and some variables have been initialised to their default values.

from foolbox.

jonasrauber avatar jonasrauber commented on May 24, 2024

I added a new page in the documentation with examples, in particular lot's of examples of the different ways to create a foolbox.models.TensorFlowModel: https://foolbox.readthedocs.io/en/latest/user/examples.html

@ivust What you are using right now is basically Option 4. Have a look at the other options, I think Option 1, Option 2 and Option 3 are nicer.

Your proposal,

session = tf.Session()
restorer.restore(session, '/path/to/vgg_19.ckpt')
model = foolbox.models.TensorFlowModel(images, logits, (0, 255), session=session)
print(np.argmax(model.predictions(image)))
session.close()

is basically a fifth option that's almost identical to Option 3 and therefore will not be implemented for now (I would however accept pull-requests for this, if you really want it).

from foolbox.

jonasrauber avatar jonasrauber commented on May 24, 2024

Considering this solved. @ivust let me know if I missed something.

from foolbox.

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.