-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
97 lines (90 loc) · 3 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Author:yujunyu
# -*- codeing = utf-8 -*-
# @Time :2022/9/9 16:20
# @Author :yujunyu
# @Site :
# @File :test.py
# @software: PyCharm
"""
┏┛ ┻━━━━━┛ ┻┓
┃ ┃
┃ ━ ┃
┃ ┳┛ ┗┳ ┃
┃ ┃
┃ ┻ ┃
┃ ┃
┗━┓ ┏━━━┛
┃ ┃ 神兽保佑
┃ ┃ 代码无BUG!
┃ ┗━━━━━━━━━┓
┃CREATE BY SNIPER┣┓
┃ ┏┛
┗━┓ ┓ ┏━━━┳ ┓ ┏━┛
┃ ┫ ┫ ┃ ┫ ┫
┗━┻━┛ ┗━┻━┛
"""
# save_epoch=1
#
# for e in range(100):
# if e%save_epoch==0:
# print('y')
# else:
# print('n')
# import os
# filePath = './dataset/image'
# for i,j,k in os.walk(filePath):
# # print(k)#直接输出文件名
# #一个文件名一行,输出
# for s in k:
# print(s)
lr = 0.001
lr_down_epoch = 20
lr_list=[]
for e in range(1, 100):
print(lr)
# 按lr_down_epoch降低lr
lr_list.append(lr)
if e % lr_down_epoch == 0:
lr = lr / 5
#
#
# from matplotlib import pyplot as plt
#
# x1 = range(1, 100)
# plt.subplot(2, 2, 1)
# # plt.plot(x1, train_accuracy_list, 'o-', label='train accuracy')
# # plt.plot(x1, val_accuracy_list, 'o-', label='val_acc')
# plt.ylabel('accuracy')
# plt.legend(loc='best')
# plt.subplot(2, 2, 2)
# # plt.plot(x1, train_loss_list, '.-', label='train_loss')
# # plt.plot(x1, val_loss_list, '.-', label='val_loss')
# plt.ylabel('loss')
# plt.legend(loc='best')
# plt.subplot(2, 2, 3)
# plt.plot(x1, lr_list, '.-', label='learing_rate')
# plt.ylabel('lr')
# plt.legend(loc='best')
# plt.show()
from numpy import array,float32
import wandb
#
# wandb.init(project="垃圾分类", entity="yujunyu")
#
# epoch_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
# train_accuracy_list = [array(99.782135, dtype=float32), array(99.6732, dtype=float32), array(99.782135, dtype=float32),
# array(99.782135, dtype=float32), array(99.72767, dtype=float32), array(99.782135, dtype=float32),
# array(99.72767, dtype=float32), array(99.8366, dtype=float32), array(99.782135, dtype=float32),
# array(99.782135, dtype=float32)]
# test_accuracy_list = [array(99.99999, dtype=float32), array(99.99999, dtype=float32), array(99.99999, dtype=float32),
# array(99.99999, dtype=float32), array(99.99999, dtype=float32), array(99.99999, dtype=float32),
# array(99.99999, dtype=float32), array(99.99999, dtype=float32), array(99.99999, dtype=float32),
# array(99.99999, dtype=float32)]
#
# wandb.log({"train/test accuracy": wandb.plot.line_series(
# xs=epoch_list,
# ys=[train_accuracy_list, test_accuracy_list],
# keys=["train_acc", "test_acc"],
# title="Train/Test Accuracy",
# xname="epoch")
# })