Because container_abcs has been removed after version 1.8.
cannot import name 'container_abcs' from 'torch._six'
You may encounter this error when using some open source code.
The solution is also very simple, we just need to replace it.
TORCH_MAJOR = int(torch.__version__.split('.')[0])
TORCH_MINOR = int(torch.__version__.split('.')[1])
if TORCH_MAJOR == 1 and TORCH_MINOR < 8:
from torch._six import container_abcs
else:
import collections.abc as container_abcs