Typeerror: Only Integers, Slices (`:`), Ellipsis (`…`), Tf.newaxis (`none`) And Scalar Tf.int32/tf.int64 Tensors Are Valid Indices, Got [1, 3]
I am trying to train a 3D segmentation Network from Github. My model is implemented by Keras (Python) which is a typical U-Net model. The model, summary is given below, Model: 'fun
Solution 1:
The error says it directly: you give [1,3] which is a list, where it expects either a number or a slice.
Maybe you meant [1:3] ?
You seem to give the [1,3] there so maybe should change:
y_core=K.sum(y_true_f[:,[1,3]],axis=1)
to
y_core=K.sum(y_true_f[1:3],axis=1)
That's at least valid syntax, am not sure if it does what you want.
Post a Comment for "Typeerror: Only Integers, Slices (`:`), Ellipsis (`…`), Tf.newaxis (`none`) And Scalar Tf.int32/tf.int64 Tensors Are Valid Indices, Got [1, 3]"