# f = open('/data/llx/VL-T5-main-98/vlt5-log/slurm-333526.out', 'r')
# f = open('/data/llx/VL-T5-main-98/VL-T5/scripts/ckpt-98.log', 'r')
# num = 0
#
# lable_2018 = -2
# lable_2017 = -2
# lable_2016 = -2
# score_2016 = 0
# score_2017 = 0
# score_2018 = 0
#
#
# def score(item):
#     begin = item.find(':')
#     end = item.find('}')
#     score = item[begin + 2:end]
#     score = float(score)
#     return score
#
#
# epoch = 21
#
# for index, item in enumerate(f):
#     # print(item)
#
#     if 'test_2018_flickr set results' in item:
#         lable_2018 = index
#     if index == lable_2018 + 1:
#         score_2018 = score(item)
#         print('test_2016_flickr set results:', score_2016)
#         print('test_2017_flickr set results:', score_2017)
#         print('test_2018_flickr set results:', score_2018)
#         D_value = (39.5 - score_2018) + (42.4 - score_2017)
#         print('总差值：', D_value)
#         print('epoch:', epoch)
#         epoch = epoch + 1
#         print('------------------------------------------------------------------------------')
#         lable_2018 = -2
#
#     if 'test_2017_flickr set results' in item:
#         lable_2017 = index
#     if index == lable_2017 + 1:
#         score_2017 = score(item)
#         lable_2017 = -2
#
#     if 'test_2016_flickr set results' in item:
#         lable_2016 = index
#     if index == lable_2016 + 1:
#         score_2016 = score(item)
#         lable_2016 = -2
# for epoch in range(50):
#     alpha = 0.002
#     begin_alpha = 0.002
#     end_alpha = 0.0005
#     if epoch > 30:
#         diff = (begin_alpha - end_alpha) / 19
#         alpha = begin_alpha - (epoch - 30) * diff
#     print(alpha)
# f = open('/data/llx/VL-T5-main-98/datasets/multi30k-dataset/data/task1/raw/test_2016_flickr.de', 'r')
f = open('/data/llx/VL-T5-main-98/VL-T5/scripts/snap/Multi30K/VLT5-97/submit_test_2016_flickr_raw.txt', 'r')
num = 0
for item in f:
    num = num + 1
    print(item)
print(num)
