You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ python examples/mnist_siamese.py
Using CNTK backend
Selected GPU[0] Tesla K40c as the process wide default device.
Traceback (most recent call last):
File "examples/mnist_siamese.py", line 128, in
model.compile(loss=contrastive_loss, optimizer=rms, metrics=[accuracy])
File "/home/xxx/project/keras/keras/engine/training.py", line 934, in compile
handle_metrics(output_metrics)
File "/home/xxx/project/keras/keras/engine/training.py", line 931, in handle_metrics
mask=masks[i])
File "/home/xxx/project/keras/keras/engine/training.py", line 459, in weighted
score_array = fn(y_true, y_pred)
File "examples/mnist_siamese.py", line 91, in accuracy
return K.mean(K.equal(y_true, K.cast(y_pred < 0.5, y_true.dtype)))
TypeError: '<' not supported between instances of 'Function' and 'float'
Using CNTK backend
keras.version = '2.1.1'
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
This isn't really a bug. It's because you can't use comparaison operators with the cntk backend.
Source: discussion during the cntk integration. #6800
You should use K.greater_than() instead.
If it solves your problem, feel free to close the issue.
just run the example from keras:
$ python examples/mnist_siamese.py
Using CNTK backend
Selected GPU[0] Tesla K40c as the process wide default device.
Traceback (most recent call last):
File "examples/mnist_siamese.py", line 128, in
model.compile(loss=contrastive_loss, optimizer=rms, metrics=[accuracy])
File "/home/xxx/project/keras/keras/engine/training.py", line 934, in compile
handle_metrics(output_metrics)
File "/home/xxx/project/keras/keras/engine/training.py", line 931, in handle_metrics
mask=masks[i])
File "/home/xxx/project/keras/keras/engine/training.py", line 459, in weighted
score_array = fn(y_true, y_pred)
File "examples/mnist_siamese.py", line 91, in accuracy
return K.mean(K.equal(y_true, K.cast(y_pred < 0.5, y_true.dtype)))
TypeError: '<' not supported between instances of 'Function' and 'float'
Using CNTK backend
keras.version = '2.1.1'
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
$ python -c "import cntk; print(cntk.version)"
2.3.1
The text was updated successfully, but these errors were encountered: