Skip to content

Commit 72df11e

Browse files
AndyDengAndyDeng
authored andcommitted
debug
1 parent 724383e commit 72df11e

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

train_pytorch.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232
random.seed(0)
33-
dtype = torch.FloatTensor
33+
dtype = torch.cuda.FloatTensor
3434

3535
class modelnet40_dataset(Dataset):
3636

@@ -68,14 +68,6 @@ def __init__(self):
6868
Dense( 64, 40, with_bn = False, activation = None)
6969
)
7070

71-
self.test_fcn = nn.Linear(1024*3, 40)
72-
'''
73-
def forward(self, x):
74-
x = x[0]
75-
x = x.view(x.size(0), -1)
76-
logits = self.test_fcn(x)
77-
return logits
78-
'''
7971
def forward(self, x):
8072
x = self.pcnn1(x)
8173
if False:
@@ -136,9 +128,9 @@ def forward(self, x):
136128
scaling_range = [0.05, 0.05, 0.05, 'g']
137129
scaling_range_val = [0, 0, 0, 'u']
138130

139-
print("before model")
131+
print("------Building model-------")
140132
model = Classifier().cuda()
141-
print("after model")
133+
print("------Successfully Built model-------")
142134

143135
decay_steps = FLAGS.decay_step
144136
decay_rate = FLAGS.decay_rate
@@ -212,9 +204,9 @@ def forward(self, x):
212204

213205
out = model((P_sampled, P_sampled))
214206
loss = loss_fn(out, label)
215-
#print("epoch: "+str(epoch) + " loss: "+str(loss))
216207
loss.backward()
217208
optimizer.step()
209+
print("epoch: "+str(epoch) + " loss: "+str(loss.data[0]))
218210
if global_step % 25 == 0:
219211
loss_v = loss.data[0]
220212
print("Loss:", loss_v)

0 commit comments

Comments
 (0)