Do you see any log outputs and could use it to narrow down the lines of code raising the error?
If so, log the shapes of the used tensors and post the operation here, so that we could have a look why the shape mismatch is raised.