Skip to content
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

ValueError: Expected a symbolic Tensors or a callable for the loss value. Please wrap your loss computation in a zero argument lambda. #26

Open
duncan1126 opened this issue Sep 19, 2022 · 1 comment

Comments

@duncan1126
Copy link

訓練時遇到以下錯誤
請問有相關經驗嗎
謝謝

Traceback (most recent call last):
File "train.py", line 311, in
layer.add_loss(l2(weight_decay)(layer.kernel))
File "D:\python37\lib\site-packages\keras\engine\base_layer.py", line 1585, in add_loss
'Expected a symbolic Tensors or a callable for the loss value. '
ValueError: Expected a symbolic Tensors or a callable for the loss value. Please wrap your loss computation in a zero argument lambda.


RTX3080
CUDA11.2
TENSORFLOW 2.8.0
KERAS 2.8.0

@bubbliiiing
Copy link
Owner

貌似版本新了些

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

No branches or pull requests

2 participants