ShusenTang / Dive-into-DL-PyTorch

本项目将《动手学深度学习》(Dive into Deep Learning)原书中的MXNet实现改为PyTorch实现。
http://tangshusen.me/Dive-into-DL-PyTorch
Apache License 2.0
18.17k stars 5.38k forks source link

5.10 批量归一化 #129

Open bradzhang1128 opened 4 years ago

bradzhang1128 commented 4 years ago

bug描述 第一个epoch 没问题 第二个epoch, 出现如下问题: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time.

修改loss.backward()为loss.backward(retain_graph)以后还是有问题 可能跟computation graph 有关?求解 还有人遇到么 版本信息 pytorch: torchvision: torchtext: ...