Based on the error message it seems torchsampler tries to call dataset.dataset.imgs, which apparently isn’t a valid attribute. I’m not familiar with the implementation of torchsampler and also cannot find a repository of it to check what might be failing.