tf-keras-vis
tf-keras-vis copied to clipboard
cannot use BinaryScore
Hi, Thank you for this git! Is fantastic.
I'm having problems tying to use this for binary classification.
Can you show an example using it?
Please refer the page below:
https://keisen.github.io/tf-keras-vis-docs/api/tf_keras_vis.utils.scores.html#binary-classification-task
Thanks!
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...
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)
I face the same Graph disconnected error