Skip to content

Commit 67648e8

Browse files
committed
2 parents 8714220 + 8825fbb commit 67648e8

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
2+
<!--
13
<p align="center">
24
<a href="https://study.163.com/course/introduction/1208894818.htm?share=2&shareId=480000001847407
35
">
46
<img src="res/ad_banner.png">
57
</a>
68
</p>
7-
9+
-->
810
**课程链接:** https://study.163.com/provider/480000001847407/index.htm?share=2&shareId=480000001847407
911

1012
<p align="center">
1113
<img width="300" src="res/cover.png">
1214
</p>
15+
1316

1417
**课程大纲:**
1518
![课程介绍](res/outline.png)

lesson63-迁移学习-自定义数据集实战/train_scratch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
viz = visdom.Visdom()
3030

3131
def evalute(model, loader):
32+
model.eval()
33+
3234
correct = 0
3335
total = len(loader.dataset)
3436

@@ -58,7 +60,8 @@ def main():
5860

5961
# x: [b, 3, 224, 224], y: [b]
6062
x, y = x.to(device), y.to(device)
61-
63+
64+
model.train()
6265
logits = model(x)
6366
loss = criteon(logits, y)
6467

@@ -94,4 +97,4 @@ def main():
9497

9598

9699
if __name__ == '__main__':
97-
main()
100+
main()

lesson63-迁移学习-自定义数据集实战/train_transfer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
viz = visdom.Visdom()
3131

3232
def evalute(model, loader):
33+
model.eval()
34+
3335
correct = 0
3436
total = len(loader.dataset)
3537

@@ -68,6 +70,7 @@ def main():
6870
# x: [b, 3, 224, 224], y: [b]
6971
x, y = x.to(device), y.to(device)
7072

73+
model.train()
7174
logits = model(x)
7275
loss = criteon(logits, y)
7376

@@ -103,4 +106,4 @@ def main():
103106

104107

105108
if __name__ == '__main__':
106-
main()
109+
main()

0 commit comments

Comments
 (0)