GithubHelp home page GithubHelp logo

Comments (3)

juesato avatar juesato commented on July 28, 2024

Hi, thanks for the interest. We don't directly expose the internal activations of the network via the TF-Hub interface, but you can do this in an adhoc way via get_tensor_by_name.

You might find these other threads helpful, which also discuss how to retrieve internal activations from TF-Hub modules.
tensorflow/hub#290
tensorflow/hub#396

For figuring out the names of each Tensor, I would use some combination of (1) inspecting the names of Tensors and Variables and (2) checking op.inputs and op.outputs.
As a final helpful tip, the model is also divided into Variable scopes based on each ResNet "block" and then "layers" within each block (the same way the architecture is described in https://arxiv.org/abs/1605.07146), so if e.g. you're trying to retrieve the activation after each residual block, this should basically involve changing a single number e.g. '/long/variable/scope/path/resnet_block_1/MatMul:0' to '/long/variable/scope/path/resnet_block_2/MatMul:0'

from deepmind-research.

diegolascasas avatar diegolascasas commented on July 28, 2024

Closing this issue, feel free to reopen it if you have further questions.

from deepmind-research.

wmcnally avatar wmcnally commented on July 28, 2024

@diegolascasas Are there any plans to improve the interface of TF Hub to facilitate getting outputs of intermediate layers? TF Hub seems like a great resource (lots of pre-trained models) but without being able to interface intermediate layers the applications are severely limited (e.g., I cannot easily build a custom model). I'm currently using tf.keras.applications -- I would like to use some of the architectures in TF Hub in the same way.

from deepmind-research.

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.