Hi~ryan! I have the same problem converting from keras to pytorch. May I ask at the end how do you fix the problem? I followed the track but it seems you did not change your code at the end. Thanks a lot!