-
Notifications
You must be signed in to change notification settings - Fork 65
Use of constant tensor in custom loss fails #224
Comments
I can reproduce the problem both on windows with CUDA and on linux / CPU. |
Hi @efournie, unfortunately custom loss is not supported now due to we can't register this loss with mxnet backend. But you can always add it in the losses.py and import it in your script. refer to this custom loss: https://github.com/awslabs/keras-apache-mxnet/blob/master/keras/losses.py#L77 |
I have the same problem. I added my custom loss function to losses.py, but still I get the following error message:
|
@roywei can you please elaborate on your solution here? I tried adding it to the losses.py locally and am still running into the same issue. |
Hello,
I am trying to use a mask in a custom loss function but with the mxnet backend, the program fails with the following error:
Switching to the tensorflow backend removes the error and the program can run as expected.
The issue can be reproduced with this minimal example:
I also tried to use Multiply layers in the model definition to work around the issue without success. Unfortunately, I can't pinpoint the exact cause of the problem in the Keras backend.
The text was updated successfully, but these errors were encountered: