It appears that the "torch" folder, from which you are trying to import the torch.utils
module, is being overshadowed by the PyTorch package (import torch
) because of the identical name. Try renaming the "torch" folder to something different, to avoid using the reserved name used by the PyTorch package.