Skip to content

Commit 3c88674

Browse files
committed
Remove log_softmax on inference
1 parent 27336ee commit 3c88674

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

demo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import matplotlib.colors
44
import matplotlib.pyplot as plt
5-
import torch.nn.functional as F
65
import torch.utils.data
76
import tqdm
87

@@ -46,7 +45,6 @@
4645
with torch.cuda.amp.autocast(enabled=config['amp_enabled']):
4746
with torch.no_grad():
4847
output = model(image)
49-
output = F.log_softmax(output, dim=1)
5048
output = torch.argmax(output, dim=1)
5149

5250
# 1 배치단위 처리

eval.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import numpy as np
66
import sklearn.metrics
77
import torch.nn as nn
8-
import torch.nn.functional as F
98
import torch.utils.data
109
import tqdm
1110

@@ -70,7 +69,6 @@ def evaluate(model, testloader, criterion, num_classes: int, amp_enabled: bool,
7069
val_loss += criterion(output, target).item()
7170

7271
# Segmentation map 만들기
73-
output = F.log_softmax(output, dim=1)
7472
output = torch.argmax(output, dim=1)
7573

7674
# 혼동행렬 업데이트

0 commit comments

Comments
 (0)