TypeError: object of type 'int' has no len() return len(self._index_sampler)

When running pytorch,I found this error

Based on the error message self._index_sampler is an int and thus the len() call fails. In case you get stuck, please post a minimal, executable code snippet to reproduce the issue.