Initially, restart the kernel.
Then check if you have done the initial part correct, i.e.
x = X[:,t,:]
Maybe this may solve your error.