Thank you!
[ ] Check that you are up-to-date with the master branch of Keras. You can update with:
pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps
[x] If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.
[ ] If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with:
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
[x] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
I am using Google Colab to train a CNN and then save the entire model to a .h5 file. The code is available here: CNN-Colab
The model gets saved but when I later try to load it back, I get the following error:
TypeError: float() argument must be a string or a number, not 'dict'
The entire Output log is here: CNN - Colab - Error
Closing this issue since the fixed has been merged. Feel free to reopen the issue if the problem still persists. Thanks!
Is there a way to apply the fix as a patch to Tensorflow 1.12 installed in Anaconda?
Edit:
For those looking to fix this issue, follow these steps.
import tensorflowtensorflow.__file__ to find the location of your tensorflow install (call this $TENSORFLOW_DIR)$TENSORFLOW_DIR/python/keras/layers/advanced_activations.pyTypeError: float() argument must be a string or a number message, a few lines up there should be a trace from advanced_activations.py.try:
self.SOME_VALUE = K.cast_to_floatx(SOME_VALUE)
except TypeError:
self.SOME_VALUE = K.cast_to_floatx(SOME_VALUE['value'])
Most helpful comment
Is there a way to apply the fix as a patch to Tensorflow 1.12 installed in Anaconda?
Edit:
For those looking to fix this issue, follow these steps.
import tensorflowtensorflow.__file__to find the location of your tensorflow install (call this $TENSORFLOW_DIR)$TENSORFLOW_DIR/python/keras/layers/advanced_activations.pyTypeError: float() argument must be a string or a numbermessage, a few lines up there should be a trace from advanced_activations.py.try: self.SOME_VALUE = K.cast_to_floatx(SOME_VALUE) except TypeError: self.SOME_VALUE = K.cast_to_floatx(SOME_VALUE['value'])