keisen / tf-keras-vis

Neural network visualization toolkit for tf.keras
https://keisen.github.io/tf-keras-vis-docs/
MIT License
313 stars 45 forks source link

problem after updating to tensorflow 2.5 and keras 2.4 - Expected `model` argument #72

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi,

just after updating tensorflow to 2.5.0 and keras to 2.4.3, I can not use tf_keras_vis anymore, when I pass my model to functions I get ('Expectedmodelargument to be aModelinstance, got ', <keras.engine.functional.Functional object at 0x00000230BFDB2AC0>) I also upgraded the tf-keras-vis package, but still I get the same error.

did anyone else face the same thing?

keisen commented 3 years ago

Are you importing keras package as below?

import keras

model = keras.Model(...

Tensorflow2.5 doesn't support for keras package. Instead, keras module are provided as tensorflow.keras. So you should implement it as below.

import tensorflow as tf

model = tf.keras.Model(...

Thanks!

keisen commented 3 years ago

Hi, @kinaikan . Although I believe that the problem was resolved, do you have any other questions or problems? I'm going to close this issue. When you're facing any problem, please feel free to re-open this issue.

Finally, if you like tf-keras-vis, please star this repository. Thanks!

ghost commented 3 years ago

Hi, @keisen .

sry I was busy last week. I will check your suggestion this weekend and report back to you.

Thanks.