The error is raised if your Dataset is returning tensors with a variable shape or a different number of dimensions.
In your case it seems that a some tensors have 3 dimensions while others have 4.
Could you check that and let us know if you get stuck?