Skip to content

Commit 6fc931d

Browse files
committed
fix bug
1 parent 8a278b4 commit 6fc931d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

04-Convolutional Neural Network/convolution_network.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def forward(self, x):
7676
if use_gpu:
7777
img = Variable(img).cuda()
7878
label = Variable(label).cuda()
79+
else:
80+
img = Variable(img)
81+
label = Variable(label)
7982
# 向前传播
8083
out = model(img)
8184
loss = criterion(out, label)

05-Recurrent Neural Network/recurrent_network.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ def forward(self, x):
7070
if use_gpu:
7171
img = Variable(img).cuda()
7272
label = Variable(label).cuda()
73+
else:
74+
img = Variable(img)
75+
label = Variable(label)
7376
# 向前传播
7477
out = model(img)
7578
loss = criterion(out, label)

0 commit comments

Comments
 (0)