adding summary to tensorflow model error
Check out dimension

 X = data[0]
 Y = data[1]


Its likely that have dimensions like (1, ) what means that's 1 dim vector.

That should be work

import numpy as np
X = np.array(X).reshape(-1,1)
Y = np.array(Y).reshape(-1,1)