Tag Archives: ModuleNotFoundError: No module named ‘torch.utils.serialization’

ModuleNotFoundError: No module named ‘torch.utils.serialization’ [How to Solve]

 

1. There is a problem

ModuleNotFoundError: No module named 'torch.utils.serialization'

2. Analyze the reasons

it may be that the version of Python is too new to cause

3. Solutions

1. Install the older version of Python 2

2. Replace with a new version of function: torchfile 2

(1) install torchfile

pip install torchfile

(2)from torch.utils.serialization import load_lua to import torchfile

(3)load_lua to torchfile.load