Thanks for reporting this issue.
After fixing some legacy code, such as:
targets, class_counts = get_labels_and_class_counts(
                self.dataset.targets)

I can run the code without the issue in line272.
Are you seeing any other issues before this failure?