cs230-stanford / cs230-code-examples

Code examples in pyTorch and Tensorflow for CS230
Other
3.9k stars 996 forks source link

Batch norm layer fails when batch_size is set to 1 #19

Open johntiger1 opened 5 years ago

johntiger1 commented 5 years ago

When running the code, I found that this particular layer (and only this one) fails when the batch size is set to 1.

https://github.com/cs230-stanford/cs230-code-examples/blob/159df10a6187c7e1d6ec949c8e06d7f67f8f1cd2/pytorch/vision/model/net.py#L78