Skip to content

Fix for tf.keras: Cast input_dims to int.#4

Open
fa9r wants to merge 1 commit intoIShengFang:masterfrom
fa9r:master
Open

Fix for tf.keras: Cast input_dims to int.#4
fa9r wants to merge 1 commit intoIShengFang:masterfrom
fa9r:master

Conversation

@fa9r
Copy link

@fa9r fa9r commented Dec 28, 2019

Currently, your code only works for regular Keras, but not for tf.keras, because input_shape is a tensor in Tensorflow. By simply casting all input_dim to int, your code should work for both Keras (where input_dim is already int) and tf.keras.

This is useful, because some TF functionalities (like efficient data loading) only work with tf.keras, and tf.keras and keras layers cannot be combined.

To see how imports have to be changed for tf.keras, see https://github.com/fa9r/SpectralNormalizationTensorflowKeras

…y int in Keras, this should not affect Keras functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant