soft-decision-tree icon indicating copy to clipboard operation
soft-decision-tree copied to clipboard

when I try to run this demo, I met a mistake. I could not figure out why?

Open littlehacker26 opened this issue 7 years ago • 6 comments

Traceback (most recent call last): File "C:/Users/woai_fish/Desktop/android/soft-decision-tree-master/main.py", line 100, in model.train_(train_loader, epoch) File "C:\Users\woai_fish\Desktop\android\soft-decision-tree-master\model.py", line 193, in train_ loss, output = self.cal_loss(data, self.target_onehot) File "C:\Users\woai_fish\Desktop\android\soft-decision-tree-master\model.py", line 133, in cal_loss leaf_accumulator = self.root.cal_prob(x, self.path_prob_init) File "C:\Users\woai_fish\Desktop\android\soft-decision-tree-master\model.py", line 58, in cal_prob self.prob = self.forward(x) # probability of selecting right node File "C:\Users\woai_fish\Desktop\android\soft-decision-tree-master\model.py", line 48, in forward return (F.sigmoid(self.beta * self.fc(x))) File "E:\Conda\envs\android\lib\site-packages\torch\autograd\variable.py", line 757, in mul return self.mul(other) File "E:\Conda\envs\android\lib\site-packages\torch\autograd\variable.py", line 301, in mul return Mul.apply(self, other) File "E:\Conda\envs\android\lib\site-packages\torch\autograd_functions\basic_ops.py", line 50, in forward return a.mul(b) RuntimeError: inconsistent tensor size at d:\downloads\pytorch-master-1\torch\lib\th\generic/THTensorMath.c:847

littlehacker26 avatar Mar 15 '18 01:03 littlehacker26

I cannot reproduce this error. Would you tell me exactly what you did? and your pytorch/python version

kimhc6028 avatar Mar 15 '18 08:03 kimhc6028

Yes,I also suspected this issue!I am trying to try another python version!Can you tell me your tools version that have no errors? My Version Message: python=3.6 torch=0.1.12

littlehacker26 avatar Mar 15 '18 08:03 littlehacker26

python 3.5.2 pytorch 0.3.1

kimhc6028 avatar Mar 15 '18 08:03 kimhc6028

Thanks you very much! I will try it latter!

littlehacker26 avatar Mar 15 '18 08:03 littlehacker26

I can't find pytorch 0.3.1!

kiki28 avatar Dec 10 '18 14:12 kiki28

@kiki28 This repo is updated to match pytorch 0.4.0. Please pull master branch again, and update your pytorch to 0.4.0. That should work.

kimhc6028 avatar Dec 12 '18 09:12 kimhc6028