Got Segment fault when I run example code in tutorial

I run neural networks example in tutorial and got segment fault as follows:

(conv1): Conv2d(1, 6, kernel_size=(5, 5), stride=(1, 1))
(conv2): Conv2d(6, 16, kernel_size=(5, 5), stride=(1, 1))
(fc1): Linear(in_features=400, out_features=120, bias=True)
(fc2): Linear(in_features=120, out_features=84, bias=True)
(fc3): Linear(in_features=84, out_features=10, bias=True)
torch.Size([6, 1, 5, 5])
Segmentation fault

Could anybody help me for this?

running in jupyter notebook, it shows that code of defining network is OK, error occurs in the statement of feedforward as follows:

input = torch.randn(1, 1, 32, 32)
(error)---------->out = net(input)

Have you solved the problem? Facing the same situation, including has no attribute ‘empty’

It might be some issue with your pytorch install. Maybe try a fresh install.

No, this problem may be concerns the installation of pytorch, my student reinstall the pytorch with python3.5 for me,
but the error appear yet, but in pytorch+python2.7, everything is ok. So I am now working at that environment.

Try pytorch0.4.0. You can find it in conda. I updated pytorch to 0.4.0 and the code runs very well in python3.6.