c3di/neuroscope

Can't load model created by tf-keras

Closed this issue · 1 comments

Hi, first of all, Thank you so much for the valuable contribution to the community,

I was wondering if there was a simple way to load a model created by tf-keras using your tool? I've tried to modify your tool to accept the tf-keras model, although my model was successfully loaded and displayed, when I make a prediction by clicking the Inspection then selecting layer and Grad-CAM, this error will appear:

tensorflow.python.framework.errors_impl.FailedPreconditionError: Error while reading resource variable conv2d_5/kernel from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/conv2d_5/kernel)
     [[{{node conv2d_5/Conv2D/ReadVariableOp}} = ReadVariableOp[dtype=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](conv2d_5/kernel)]]

After fixing this issue by adding session and default graph, I was able to pass this error, however another error will arrive:
ValueError: Tensor Tensor("conv2d_11/BiasAdd:0", shape=(?, 544, 960, 2), dtype=float32) is not an element of this graph.
caused by this line:
compute_output_function = K.function(inputs=[model.native_model.input], outputs=[target_layer_output])

Do you have any idea how to overcome this kind of problem or plan to upgrade your tool in the future?
Once again, thank you for your time and consideration!

Sorry, we only support Keras, not tf-keras.