Coder Social home page Coder Social logo

cannot use BinaryScore about tf-keras-vis HOT 3 OPEN

rEstela avatar rEstela commented on June 12, 2024
cannot use BinaryScore

from tf-keras-vis.

Comments (3)

keisen avatar keisen commented on June 12, 2024

Please refer the page below:

https://keisen.github.io/tf-keras-vis-docs/api/tf_keras_vis.utils.scores.html#binary-classification-task

Thanks!

from tf-keras-vis.

rEstela avatar rEstela commented on June 12, 2024

Thank you,
This is what I was looking for. Somehow didn't see these instructions O.o

I tried to use it on a simpler example (cat and dog binary classification) and it worked!

My problem now is when i have nested models...

Model1

Model2_1

Model2_2

I used the code:

score = BinaryScore(1.0)

replace2linear = ReplaceToLinear()

gradcam = Gradcam(model,
model_modifier=replace2linear,
clone=True)

cam = gradcam(score,
x_img,
penultimate_layer=-1)

But i got the following error:

ValueError: Graph disconnected: cannot obtain value for tensor KerasTensor(type_spec=TensorSpec(shape=(None, 141, 898, 1), dtype=tf.float32, name='conv2d_12_input'), name='conv2d_12_input', description="created by layer 'conv2d_12_input'") at layer "conv2d_12". The following previous layers were accessed without issue: []

If i do:

model2 = model2 = model.layers[1]

I have:

ValueError: output shape must be (batch_size, 1), but was (1, 64)

from tf-keras-vis.

IshaanShettigar avatar IshaanShettigar commented on June 12, 2024

I face the same Graph disconnected error

from tf-keras-vis.

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.