raghakot / keras-vis

Neural network visualization toolkit for keras
https://raghakot.github.io/keras-vis
MIT License
2.98k stars 664 forks source link

Failed precondition: Error while reading resource variable x13_dense_model1_2/bias from Container #213

Closed neso613 closed 2 years ago

neso613 commented 4 years ago

Hi

I am trying to generate attenation map on my custom model. I am getting this error
FailedPreconditionError: 2 root error(s) found. (0) Failed precondition: Error while reading resource variable x13_dense_model1_2/bias from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/x13_dense_model1_2/bias) [[{{node x13_dense_model1_2/BiasAdd/ReadVariableOp}}]] [[gradients/x1_conv_model1_2/Conv2D_grad/Conv2DBackpropInput/_89]] (1) Failed precondition: Error while reading resource variable x13_dense_model1_2/bias from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/x13_dense_model1_2/bias) [[{{node x13_dense_model1_2/BiasAdd/ReadVariableOp}}]] 0 successful operations. 0 derived errors ignored.

when I am trying to visiulize using this code for i, img in enumerate([img1, img2]): grads = visualize_saliency(model, layer_idx, filter_indices=3, seed_input=img) ax[i].imshow(grads, cmap='jet')

Looking for help.