InvalidArgumentError: Incompatible shapes: [6,2,3] vs. [6,1] what does
this means.
что означает несовместимая форма
InvalidArgumentErrorTraceback (последний вызов был последним)
в ()
----> 1 odel.fit (x, y, epochs = 500)
4 frames
/usr/local/lib/python2.7/dist-
packages/tensorflow/python/framework/errors_impl.pyc in __exit__(self,
type_arg, value_arg, traceback_arg)
526 None, None,
527 compat.as_text(c_api.TF_Message(self.status.status)),
--> 528 c_api.TF_GetCode(self.status.status))
529 # Delete the underlying status object from memory otherwise it
stays alive
530 # as there is a reference to status from this from the traceback
due to
InvalidArgumentError: Incompatible shapes: [6,2,3] vs. [6,1]
[ ]
> Blockquote
import tensorflow as tf
import numpy as np
from tensorflow import keras
odel = tf.keras.Sequential([keras.layers.Dense(units=3)])
odel.compile(optimizer='sgd', loss='mean_squared_error')
x = np.array([[[1,2],[6,3]],[[3,4],[6,3]],[[4,5],[6,6]],[[5,6],[6,6]],
[[6,7],[6,4]],[[7,8],[6,2]]], dtype=float)
y = np.array([6, 10, 15, 17, 17,17], dtype=float)
odel.fit(x, y, epochs=500)
a=np.array([[2,3]])`enter code here`
print(odel.predict(a))