New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'LeakyReLU' object has no attribute '__name__' #3816
Comments
Generated data There is an issue with keras described here - keras-team/keras#3816. I modified model_fit_history.py to circumvent it. I also saved some figures.
FWIW, I ran into a similar issue when using PReLU: So I circumvented it with the following:
That fixed the problem. |
After I do it this way, the model can run normally. I use 'ModelCheckpoint' method to save the best model to a file. But when I 'load_model' from the file, it cann't distinguish the ‘PRELU’. When I transport the ‘PRELU’ to model using the parameter ‘custom_objects’ , but it still occur an error ‘Type Error: __init__( ) takes 1 positional argument but 2 were given’. |
Add LeakyReLU as shown below |
-> How about this? The reason why type error occur is I think due to keyword arguments (**kwargs) but it still occur an error ‘Type Error: init( ) takes 1 positional argument but 2 were given’.
|
leakyrelu_alpha = 0.2 gen5 = Conv2D(filters=256, kernel_size=3, strides=1, padding='same')(gen5) use this, it will solve your problem |
YES! this worked for me thanks |
Please make sure that the boxes below are checked before you submit your issue. Thank you!
pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
json serialization does not work when using advanced_activations like LeakyReLU:
The text was updated successfully, but these errors were encountered: