My code changes do two things–

Create student model directly from the specified base model and not copy layers from the teacher.
Not try to calculate hidden loss if any of the hidden layer sizes are different.

Is there something else I need to be doing? Any ideas on how to get past this error?