Category : tensorflow

The following code works without the attention thing, however when I add it as seen below I get the following error: 61 62 decoder1 = layers.Reshape(target_shape=(4,512))(decoder1) —> 63 attention = layers.Attention()([encoder,decoder1])(decoder1) 64 attention = layers.Concatenate()([encoder, decoder1])(attention) 65 TypeError: ‘KerasTensor’ object is not callable The code: encoder = layers.Reshape(target_shape=(4,512))(encoder) decoder1 = layers.LSTM(2048)(encoder) decoder1 = layers.Reshape(target_shape=(4,512))(decoder1) attention ..

Read more

Currently using these Dependencies from these snapshot repositories To try and use on device training. As shown in this article by tf https://www.tensorflow.org/lite/examples/on_device_training/overview. When I try initialising the tflite interpreter I am getting "java.lang.IllegalArgumentException: Internal error: Cannot create interpreter: Op builtin_code out of range: 142. Are you using old TFLite binary with newer model? Registration ..

Read more

x = tf.placeholder(tf.float32, (None, 2)) noise = tf.random_uniform(shape=x.get_shape) # error x += noise TypeError: Expected binary or unicode string, got <bound method Tensor.get_shape of <tf.Tensor ‘Placeholder:0’ shape=(?, 2) dtype=float32>> TypeError: Failed to convert object of type <class ‘method’> to Tensor. Contents: <bound method Tensor.get_shape of <tf.Tensor ‘Placeholder:0’ shape=(?, 2) dtype=float32>>. Consider casting elements to a ..

Read more

I have a multidimensional input (None, 8, 105) I need to access the value – i[-1:][0][-1:][0][:1] and make comparisons between y_py_actual, y_predicted and input_tensor This is more or less what I got, but the function doesn’t work def custon_loss(self, input_tensor): def loss(y_actual, y_predicted): i = input_tensor[0][-1:][0][:1] mse = K.mean(K.sum(K.square(y_actual – y_predicted))) return K.switch((K.greater(i, y_predicted) & ..

Read more