[Solved] nn.BatchNorm1d Error: RuntimeError: running_mean should contain 1 elements not 512错误

Error in adding batchnorm to pytorch model runtimeerror: running_ Mean should contain 1 elements not 512 , the error comes from nn.batchnorm1d (n), where n = channels
solution:
rearrange the input

video = video.view(-1, video.shape[-1])

Read More: