用PaddlePaddle实现图像分类-DisResNet(动态图版)

原创
2020/04/21 14:41
阅读数 1.4K

项目简介

本项目基于paddle 动态图机制实现了图像分类模型 ResNet的训练和预测,建议使用GPU来训练,具体介绍如下。

下载安装命令

## CPU版本安装命令
pip install -f https://paddlepaddle.org.cn/pip/oschina/cpu paddlepaddle

## GPU版本安装命令
pip install -f https://paddlepaddle.org.cn/pip/oschina/gpu paddlepaddle-gpu

模型简介

ResNet(Residual Neural Network)由微软研究院的Kaiming He等四名华人提出,通过使用ResNet Unit成功训练出了152层的神经网络,并在ILSVRC2015比赛中取得冠军,在top5上的错误率为3.57%,同时参数量比VGGNet低,效果非常突出。ResNet的结构可以极快的加速神经网络的训练,模型的准确率也有比较大的提升。同时ResNet的推广性非常好,甚至可以直接用到InceptionNet网络中。

ResNet的主要思想是在网络中增加了直连通道。此前的网络结构是对输入做一个非线性变换,而Highway Network则允许保留之前网络层的一定比例的输出。ResNet的思想和Highway Network的思想非常类似,其允许原始输入信息直接传到后面的层中,基本的残差结构Residual Block如下图所示。

考虑到实际应用中的计算量,作者在不同深度的ResNet中分别采用了两种不同的Residual Block,如下图所示。

当网络结构较深时,采用上图右边的block结构,首先使用1×11\times 11×1的卷积进行降维以减少计算量,然后进行3×33\times 33×3的正常卷积操作,然后再使用1×11\times 11×1的卷积进行升维,从而达到与左边结构等同的效果。不同深度的ResNet具体的参数配置如下表。 参考链接:
【1】ResNet介绍
【2】Deep Residual Learning for Image Recognition

数据介绍

使用公开鲜花据集,数据集压缩包里包含五个文件夹,每个文件夹一种花卉。分别是雏菊,蒲公英,玫瑰,向日葵,郁金香。每种各690-890张不等

In[1]
# 解压花朵数据集 
!cd data/data2815 && unzip -q flower_photos.zip 
In[2]
# 预处理数据,将其转化为标准格式。同时将数据拆分成两份,以便训练和计算预估准确率
import codecs 
import os 
import random 
import shutil 
from PIL import Image 
 
train_ratio = 4.0 / 5 
 
all_file_dir = 'data/data2815' 
class_list = [c for c in os.listdir(all_file_dir) if os.path.isdir(os.path.join(all_file_dir, c)) and not c.endswith('Set') and not c.startswith('.')] 
class_list.sort()
print(class_list) 
train_image_dir = os.path.join(all_file_dir, "trainImageSet") 
if not os.path.exists(train_image_dir): 
    os.makedirs(train_image_dir) 
     
eval_image_dir = os.path.join(all_file_dir, "evalImageSet") 
if not os.path.exists(eval_image_dir): 
    os.makedirs(eval_image_dir) 
 
train_file = codecs.open(os.path.join(all_file_dir, "train.txt"), 'w') 
eval_file = codecs.open(os.path.join(all_file_dir, "eval.txt"), 'w') 
 
with codecs.open(os.path.join(all_file_dir, "label_list.txt"), "w") as label_list: 
    label_id = 0 
    for class_dir in class_list: 
        label_list.write("{0}\t{1}\n".format(label_id, class_dir)) 
        image_path_pre = os.path.join(all_file_dir, class_dir) 
        for file in os.listdir(image_path_pre): 
            try: 
                img = Image.open(os.path.join(image_path_pre, file)) 
                if random.uniform(0, 1) <= train_ratio: 
                    shutil.copyfile(os.path.join(image_path_pre, file), os.path.join(train_image_dir, file)) 
                    train_file.write("{0}\t{1}\n".format(os.path.join(train_image_dir, file), label_id)) 
                else: 
                    shutil.copyfile(os.path.join(image_path_pre, file), os.path.join(eval_image_dir, file)) 
                    eval_file.write("{0}\t{1}\n".format(os.path.join(eval_image_dir, file), label_id)) 
            except Exception as e: 
                pass 
                # 存在一些文件打不开,此处需要稍作清洗 
        label_id += 1 
             
train_file.close() 
eval_file.close()
['daisy', 'dandelion', 'roses', 'sunflowers', 'tulips']
In[10]
# 使用鲜花数据集训练ResNet模型,具体的配置可以在work/config.py文件中进行修改
# 目前是加载上次训练的断点进行继续训练,如果需要从零训练,可以将config.py文件中的『continue_train』参数改为Fales
!python work/train.py
2020-03-09 14:44:08,142-INFO: input_size: [3, 224, 224]
[2020-03-09 14:44:08,142.142] config.py [line:85] INFO: input_size: [3, 224, 224]
2020-03-09 14:44:08,142-INFO: class_dim: 5
[2020-03-09 14:44:08,142.142] config.py [line:86] INFO: class_dim: 5
2020-03-09 14:44:08,142-INFO: continue_train: True
[2020-03-09 14:44:08,142.142] config.py [line:87] INFO: continue_train: True
2020-03-09 14:44:08,142-INFO: train_image_count: 2950
[2020-03-09 14:44:08,142.142] config.py [line:88] INFO: train_image_count: 2950
2020-03-09 14:44:08,142-INFO: eval_image_count: 720
[2020-03-09 14:44:08,142.142] config.py [line:89] INFO: eval_image_count: 720
2020-03-09 14:44:08,142-INFO: num_epochs: 15
[2020-03-09 14:44:08,142.142] config.py [line:90] INFO: num_epochs: 15
2020-03-09 14:44:08,142-INFO: train_batch_size: 64
[2020-03-09 14:44:08,142.142] config.py [line:91] INFO: train_batch_size: 64
2020-03-09 14:44:08,142-INFO: mean_rgb: [127.5, 127.5, 127.5]
[2020-03-09 14:44:08,142.142] config.py [line:92] INFO: mean_rgb: [127.5, 127.5, 127.5]
2020-03-09 14:44:08,142-INFO: save_model_dir: ./save_dir/model
[2020-03-09 14:44:08,142.142] config.py [line:93] INFO: save_model_dir: ./save_dir/model
2020-03-09 14:44:08,143-INFO: start train
[2020-03-09 14:44:08,143.143] train.py [line:60] INFO: start train
W0309 14:44:08.883675   513 device_context.cc:237] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 10.1, Runtime API Version: 9.0
W0309 14:44:08.887655   513 device_context.cc:245] device: 0, cuDNN Version: 7.3.
2020-03-09 14:44:10,368-INFO: use Adam optimizer
[2020-03-09 14:44:10,368.368] train.py [line:32] INFO: use Adam optimizer
2020-03-09 14:44:10,368-INFO: load params from ./save_dir/model
[2020-03-09 14:44:10,368.368] train.py [line:44] INFO: load params from ./save_dir/model
2020-03-09 14:44:16,730-INFO: loss at epoch 0 step 5: [1.5410353], acc: [0.390625]
[2020-03-09 14:44:16,730.730] train.py [line:99] INFO: loss at epoch 0 step 5: [1.5410353], acc: [0.390625]
2020-03-09 14:44:21,245-INFO: loss at epoch 0 step 10: [1.535567], acc: [0.421875]
[2020-03-09 14:44:21,245.245] train.py [line:99] INFO: loss at epoch 0 step 10: [1.535567], acc: [0.421875]
2020-03-09 14:44:25,953-INFO: loss at epoch 0 step 15: [1.5457927], acc: [0.390625]
[2020-03-09 14:44:25,953.953] train.py [line:99] INFO: loss at epoch 0 step 15: [1.5457927], acc: [0.390625]
2020-03-09 14:44:30,294-INFO: loss at epoch 0 step 20: [1.5417016], acc: [0.40625]
[2020-03-09 14:44:30,294.294] train.py [line:99] INFO: loss at epoch 0 step 20: [1.5417016], acc: [0.40625]
2020-03-09 14:44:34,437-INFO: loss at epoch 0 step 25: [1.539347], acc: [0.375]
[2020-03-09 14:44:34,437.437] train.py [line:99] INFO: loss at epoch 0 step 25: [1.539347], acc: [0.375]
2020-03-09 14:44:38,463-INFO: loss at epoch 0 step 30: [1.5648673], acc: [0.25]
[2020-03-09 14:44:38,463.463] train.py [line:99] INFO: loss at epoch 0 step 30: [1.5648673], acc: [0.25]
2020-03-09 14:44:42,790-INFO: loss at epoch 0 step 35: [1.5545332], acc: [0.34375]
[2020-03-09 14:44:42,790.790] train.py [line:99] INFO: loss at epoch 0 step 35: [1.5545332], acc: [0.34375]
2020-03-09 14:44:46,963-INFO: loss at epoch 0 step 40: [1.5446403], acc: [0.34375]
[2020-03-09 14:44:46,963.963] train.py [line:99] INFO: loss at epoch 0 step 40: [1.5446403], acc: [0.34375]
2020-03-09 14:44:51,339-INFO: loss at epoch 0 step 45: [1.5648222], acc: [0.265625]
[2020-03-09 14:44:51,339.339] train.py [line:99] INFO: loss at epoch 0 step 45: [1.5648222], acc: [0.265625]
2020-03-09 14:44:51,378-INFO: epoch 0 acc: [0.37432066]
[2020-03-09 14:44:51,378.378] train.py [line:102] INFO: epoch 0 acc: [0.37432066]
2020-03-09 14:44:51,379-INFO: current epoch 0 acc: [0.37432066] better than last acc: 0.0, save model
[2020-03-09 14:44:51,379.379] train.py [line:105] INFO: current epoch 0 acc: [0.37432066] better than last acc: 0.0, save model
2020-03-09 14:44:57,392-INFO: loss at epoch 1 step 5: [1.564425], acc: [0.25]
[2020-03-09 14:44:57,392.392] train.py [line:99] INFO: loss at epoch 1 step 5: [1.564425], acc: [0.25]
2020-03-09 14:45:01,610-INFO: loss at epoch 1 step 10: [1.5606048], acc: [0.28125]
[2020-03-09 14:45:01,610.610] train.py [line:99] INFO: loss at epoch 1 step 10: [1.5606048], acc: [0.28125]
2020-03-09 14:45:05,853-INFO: loss at epoch 1 step 15: [1.5528133], acc: [0.375]
[2020-03-09 14:45:05,853.853] train.py [line:99] INFO: loss at epoch 1 step 15: [1.5528133], acc: [0.375]
2020-03-09 14:45:10,228-INFO: loss at epoch 1 step 20: [1.5676885], acc: [0.328125]
[2020-03-09 14:45:10,228.228] train.py [line:99] INFO: loss at epoch 1 step 20: [1.5676885], acc: [0.328125]
2020-03-09 14:45:14,433-INFO: loss at epoch 1 step 25: [1.5454093], acc: [0.375]
[2020-03-09 14:45:14,433.433] train.py [line:99] INFO: loss at epoch 1 step 25: [1.5454093], acc: [0.375]
2020-03-09 14:45:18,711-INFO: loss at epoch 1 step 30: [1.5128758], acc: [0.484375]
[2020-03-09 14:45:18,711.711] train.py [line:99] INFO: loss at epoch 1 step 30: [1.5128758], acc: [0.484375]
2020-03-09 14:45:23,013-INFO: loss at epoch 1 step 35: [1.566294], acc: [0.296875]
[2020-03-09 14:45:23,013.013] train.py [line:99] INFO: loss at epoch 1 step 35: [1.566294], acc: [0.296875]
2020-03-09 14:45:27,181-INFO: loss at epoch 1 step 40: [1.5088985], acc: [0.5]
[2020-03-09 14:45:27,181.181] train.py [line:99] INFO: loss at epoch 1 step 40: [1.5088985], acc: [0.5]
2020-03-09 14:45:31,358-INFO: loss at epoch 1 step 45: [1.551726], acc: [0.40625]
[2020-03-09 14:45:31,358.358] train.py [line:99] INFO: loss at epoch 1 step 45: [1.551726], acc: [0.40625]
2020-03-09 14:45:31,386-INFO: epoch 1 acc: [0.38383153]
[2020-03-09 14:45:31,386.386] train.py [line:102] INFO: epoch 1 acc: [0.38383153]
2020-03-09 14:45:31,387-INFO: current epoch 1 acc: [0.38383153] better than last acc: [0.37432066], save model
[2020-03-09 14:45:31,387.387] train.py [line:105] INFO: current epoch 1 acc: [0.38383153] better than last acc: [0.37432066], save model
2020-03-09 14:45:37,488-INFO: loss at epoch 2 step 5: [1.5555053], acc: [0.390625]
[2020-03-09 14:45:37,488.488] train.py [line:99] INFO: loss at epoch 2 step 5: [1.5555053], acc: [0.390625]
2020-03-09 14:45:41,826-INFO: loss at epoch 2 step 10: [1.5086832], acc: [0.4375]
[2020-03-09 14:45:41,826.826] train.py [line:99] INFO: loss at epoch 2 step 10: [1.5086832], acc: [0.4375]
2020-03-09 14:45:45,840-INFO: loss at epoch 2 step 15: [1.5272264], acc: [0.484375]
[2020-03-09 14:45:45,840.840] train.py [line:99] INFO: loss at epoch 2 step 15: [1.5272264], acc: [0.484375]
2020-03-09 14:45:49,992-INFO: loss at epoch 2 step 20: [1.4919286], acc: [0.515625]
[2020-03-09 14:45:49,992.992] train.py [line:99] INFO: loss at epoch 2 step 20: [1.4919286], acc: [0.515625]
2020-03-09 14:45:54,233-INFO: loss at epoch 2 step 25: [1.5491793], acc: [0.359375]
[2020-03-09 14:45:54,233.233] train.py [line:99] INFO: loss at epoch 2 step 25: [1.5491793], acc: [0.359375]
2020-03-09 14:45:58,479-INFO: loss at epoch 2 step 30: [1.5264299], acc: [0.390625]
[2020-03-09 14:45:58,479.479] train.py [line:99] INFO: loss at epoch 2 step 30: [1.5264299], acc: [0.390625]
2020-03-09 14:46:02,677-INFO: loss at epoch 2 step 35: [1.5170665], acc: [0.40625]
[2020-03-09 14:46:02,677.677] train.py [line:99] INFO: loss at epoch 2 step 35: [1.5170665], acc: [0.40625]
2020-03-09 14:46:06,961-INFO: loss at epoch 2 step 40: [1.5496924], acc: [0.34375]
[2020-03-09 14:46:06,961.961] train.py [line:99] INFO: loss at epoch 2 step 40: [1.5496924], acc: [0.34375]
2020-03-09 14:46:11,285-INFO: loss at epoch 2 step 45: [1.530362], acc: [0.390625]
[2020-03-09 14:46:11,285.285] train.py [line:99] INFO: loss at epoch 2 step 45: [1.530362], acc: [0.390625]
2020-03-09 14:46:11,339-INFO: epoch 2 acc: [0.38960597]
[2020-03-09 14:46:11,339.339] train.py [line:102] INFO: epoch 2 acc: [0.38960597]
2020-03-09 14:46:11,339-INFO: current epoch 2 acc: [0.38960597] better than last acc: [0.38383153], save model
[2020-03-09 14:46:11,339.339] train.py [line:105] INFO: current epoch 2 acc: [0.38960597] better than last acc: [0.38383153], save model
2020-03-09 14:46:17,815-INFO: loss at epoch 3 step 5: [1.5399041], acc: [0.453125]
[2020-03-09 14:46:17,815.815] train.py [line:99] INFO: loss at epoch 3 step 5: [1.5399041], acc: [0.453125]
2020-03-09 14:46:22,160-INFO: loss at epoch 3 step 10: [1.5349855], acc: [0.421875]
[2020-03-09 14:46:22,160.160] train.py [line:99] INFO: loss at epoch 3 step 10: [1.5349855], acc: [0.421875]
2020-03-09 14:46:26,368-INFO: loss at epoch 3 step 15: [1.5227108], acc: [0.40625]
[2020-03-09 14:46:26,368.368] train.py [line:99] INFO: loss at epoch 3 step 15: [1.5227108], acc: [0.40625]
2020-03-09 14:46:30,758-INFO: loss at epoch 3 step 20: [1.5720688], acc: [0.265625]
[2020-03-09 14:46:30,758.758] train.py [line:99] INFO: loss at epoch 3 step 20: [1.5720688], acc: [0.265625]
2020-03-09 14:46:35,091-INFO: loss at epoch 3 step 25: [1.516247], acc: [0.421875]
[2020-03-09 14:46:35,091.091] train.py [line:99] INFO: loss at epoch 3 step 25: [1.516247], acc: [0.421875]
2020-03-09 14:46:39,429-INFO: loss at epoch 3 step 30: [1.5174167], acc: [0.421875]
[2020-03-09 14:46:39,429.429] train.py [line:99] INFO: loss at epoch 3 step 30: [1.5174167], acc: [0.421875]
2020-03-09 14:46:43,774-INFO: loss at epoch 3 step 35: [1.5360382], acc: [0.375]
[2020-03-09 14:46:43,774.774] train.py [line:99] INFO: loss at epoch 3 step 35: [1.5360382], acc: [0.375]
2020-03-09 14:46:48,035-INFO: loss at epoch 3 step 40: [1.5184169], acc: [0.34375]
[2020-03-09 14:46:48,035.035] train.py [line:99] INFO: loss at epoch 3 step 40: [1.5184169], acc: [0.34375]
2020-03-09 14:46:52,317-INFO: loss at epoch 3 step 45: [1.5176842], acc: [0.4375]
[2020-03-09 14:46:52,317.317] train.py [line:99] INFO: loss at epoch 3 step 45: [1.5176842], acc: [0.4375]
2020-03-09 14:46:52,354-INFO: epoch 3 acc: [0.39164403]
[2020-03-09 14:46:52,354.354] train.py [line:102] INFO: epoch 3 acc: [0.39164403]
2020-03-09 14:46:52,354-INFO: current epoch 3 acc: [0.39164403] better than last acc: [0.38960597], save model
[2020-03-09 14:46:52,354.354] train.py [line:105] INFO: current epoch 3 acc: [0.39164403] better than last acc: [0.38960597], save model
2020-03-09 14:46:58,484-INFO: loss at epoch 4 step 5: [1.5469303], acc: [0.296875]
[2020-03-09 14:46:58,484.484] train.py [line:99] INFO: loss at epoch 4 step 5: [1.5469303], acc: [0.296875]
2020-03-09 14:47:02,667-INFO: loss at epoch 4 step 10: [1.5298774], acc: [0.359375]
[2020-03-09 14:47:02,667.667] train.py [line:99] INFO: loss at epoch 4 step 10: [1.5298774], acc: [0.359375]
2020-03-09 14:47:07,024-INFO: loss at epoch 4 step 15: [1.5307], acc: [0.4375]
[2020-03-09 14:47:07,024.024] train.py [line:99] INFO: loss at epoch 4 step 15: [1.5307], acc: [0.4375]
2020-03-09 14:47:11,316-INFO: loss at epoch 4 step 20: [1.5312774], acc: [0.34375]
[2020-03-09 14:47:11,316.316] train.py [line:99] INFO: loss at epoch 4 step 20: [1.5312774], acc: [0.34375]
2020-03-09 14:47:15,578-INFO: loss at epoch 4 step 25: [1.558954], acc: [0.328125]
[2020-03-09 14:47:15,578.578] train.py [line:99] INFO: loss at epoch 4 step 25: [1.558954], acc: [0.328125]
2020-03-09 14:47:19,954-INFO: loss at epoch 4 step 30: [1.5051024], acc: [0.515625]
[2020-03-09 14:47:19,954.954] train.py [line:99] INFO: loss at epoch 4 step 30: [1.5051024], acc: [0.515625]
2020-03-09 14:47:24,271-INFO: loss at epoch 4 step 35: [1.5109508], acc: [0.453125]
[2020-03-09 14:47:24,271.271] train.py [line:99] INFO: loss at epoch 4 step 35: [1.5109508], acc: [0.453125]
2020-03-09 14:47:28,554-INFO: loss at epoch 4 step 40: [1.5042388], acc: [0.5]
[2020-03-09 14:47:28,554.554] train.py [line:99] INFO: loss at epoch 4 step 40: [1.5042388], acc: [0.5]
2020-03-09 14:47:32,951-INFO: loss at epoch 4 step 45: [1.5239601], acc: [0.40625]
[2020-03-09 14:47:32,951.951] train.py [line:99] INFO: loss at epoch 4 step 45: [1.5239601], acc: [0.40625]
2020-03-09 14:47:33,003-INFO: epoch 4 acc: [0.3980978]
[2020-03-09 14:47:33,003.003] train.py [line:102] INFO: epoch 4 acc: [0.3980978]
2020-03-09 14:47:33,003-INFO: current epoch 4 acc: [0.3980978] better than last acc: [0.39164403], save model
[2020-03-09 14:47:33,003.003] train.py [line:105] INFO: current epoch 4 acc: [0.3980978] better than last acc: [0.39164403], save model
2020-03-09 14:47:38,959-INFO: loss at epoch 5 step 5: [1.5232356], acc: [0.34375]
[2020-03-09 14:47:38,959.959] train.py [line:99] INFO: loss at epoch 5 step 5: [1.5232356], acc: [0.34375]
2020-03-09 14:47:42,984-INFO: loss at epoch 5 step 10: [1.5110507], acc: [0.40625]
[2020-03-09 14:47:42,984.984] train.py [line:99] INFO: loss at epoch 5 step 10: [1.5110507], acc: [0.40625]
2020-03-09 14:47:47,231-INFO: loss at epoch 5 step 15: [1.535902], acc: [0.359375]
[2020-03-09 14:47:47,231.231] train.py [line:99] INFO: loss at epoch 5 step 15: [1.535902], acc: [0.359375]
2020-03-09 14:47:51,579-INFO: loss at epoch 5 step 20: [1.5204678], acc: [0.375]
[2020-03-09 14:47:51,579.579] train.py [line:99] INFO: loss at epoch 5 step 20: [1.5204678], acc: [0.375]
2020-03-09 14:47:55,723-INFO: loss at epoch 5 step 25: [1.5214916], acc: [0.4375]
[2020-03-09 14:47:55,723.723] train.py [line:99] INFO: loss at epoch 5 step 25: [1.5214916], acc: [0.4375]
2020-03-09 14:47:59,882-INFO: loss at epoch 5 step 30: [1.5254015], acc: [0.390625]
[2020-03-09 14:47:59,882.882] train.py [line:99] INFO: loss at epoch 5 step 30: [1.5254015], acc: [0.390625]
2020-03-09 14:48:04,154-INFO: loss at epoch 5 step 35: [1.5482038], acc: [0.359375]
[2020-03-09 14:48:04,154.154] train.py [line:99] INFO: loss at epoch 5 step 35: [1.5482038], acc: [0.359375]
2020-03-09 14:48:08,450-INFO: loss at epoch 5 step 40: [1.5437732], acc: [0.359375]
[2020-03-09 14:48:08,450.450] train.py [line:99] INFO: loss at epoch 5 step 40: [1.5437732], acc: [0.359375]
2020-03-09 14:48:12,696-INFO: loss at epoch 5 step 45: [1.5397601], acc: [0.328125]
[2020-03-09 14:48:12,696.696] train.py [line:99] INFO: loss at epoch 5 step 45: [1.5397601], acc: [0.328125]
2020-03-09 14:48:12,753-INFO: epoch 5 acc: [0.39605978]
[2020-03-09 14:48:12,753.753] train.py [line:102] INFO: epoch 5 acc: [0.39605978]
2020-03-09 14:48:17,715-INFO: loss at epoch 6 step 5: [1.5248824], acc: [0.390625]
[2020-03-09 14:48:17,715.715] train.py [line:99] INFO: loss at epoch 6 step 5: [1.5248824], acc: [0.390625]
2020-03-09 14:48:21,889-INFO: loss at epoch 6 step 10: [1.4956939], acc: [0.453125]
[2020-03-09 14:48:21,889.889] train.py [line:99] INFO: loss at epoch 6 step 10: [1.4956939], acc: [0.453125]
2020-03-09 14:48:26,144-INFO: loss at epoch 6 step 15: [1.5024146], acc: [0.5]
[2020-03-09 14:48:26,144.144] train.py [line:99] INFO: loss at epoch 6 step 15: [1.5024146], acc: [0.5]
2020-03-09 14:48:30,433-INFO: loss at epoch 6 step 20: [1.5295374], acc: [0.390625]
[2020-03-09 14:48:30,433.433] train.py [line:99] INFO: loss at epoch 6 step 20: [1.5295374], acc: [0.390625]
2020-03-09 14:48:34,835-INFO: loss at epoch 6 step 25: [1.4759406], acc: [0.421875]
[2020-03-09 14:48:34,835.835] train.py [line:99] INFO: loss at epoch 6 step 25: [1.4759406], acc: [0.421875]
2020-03-09 14:48:38,936-INFO: loss at epoch 6 step 30: [1.5107508], acc: [0.421875]
[2020-03-09 14:48:38,936.936] train.py [line:99] INFO: loss at epoch 6 step 30: [1.5107508], acc: [0.421875]
2020-03-09 14:48:43,310-INFO: loss at epoch 6 step 35: [1.5453887], acc: [0.3125]
[2020-03-09 14:48:43,310.310] train.py [line:99] INFO: loss at epoch 6 step 35: [1.5453887], acc: [0.3125]
2020-03-09 14:48:47,418-INFO: loss at epoch 6 step 40: [1.4928007], acc: [0.484375]
[2020-03-09 14:48:47,418.418] train.py [line:99] INFO: loss at epoch 6 step 40: [1.4928007], acc: [0.484375]
2020-03-09 14:48:51,909-INFO: loss at epoch 6 step 45: [1.4988881], acc: [0.46875]
[2020-03-09 14:48:51,909.909] train.py [line:99] INFO: loss at epoch 6 step 45: [1.4988881], acc: [0.46875]
2020-03-09 14:48:51,957-INFO: epoch 6 acc: [0.40047553]
[2020-03-09 14:48:51,957.957] train.py [line:102] INFO: epoch 6 acc: [0.40047553]
2020-03-09 14:48:51,957-INFO: current epoch 6 acc: [0.40047553] better than last acc: [0.3980978], save model
[2020-03-09 14:48:51,957.957] train.py [line:105] INFO: current epoch 6 acc: [0.40047553] better than last acc: [0.3980978], save model
2020-03-09 14:48:58,026-INFO: loss at epoch 7 step 5: [1.5464787], acc: [0.375]
[2020-03-09 14:48:58,026.026] train.py [line:99] INFO: loss at epoch 7 step 5: [1.5464787], acc: [0.375]
2020-03-09 14:49:02,171-INFO: loss at epoch 7 step 10: [1.4772457], acc: [0.515625]
[2020-03-09 14:49:02,171.171] train.py [line:99] INFO: loss at epoch 7 step 10: [1.4772457], acc: [0.515625]
2020-03-09 14:49:06,518-INFO: loss at epoch 7 step 15: [1.4881868], acc: [0.484375]
[2020-03-09 14:49:06,518.518] train.py [line:99] INFO: loss at epoch 7 step 15: [1.4881868], acc: [0.484375]
2020-03-09 14:49:10,592-INFO: loss at epoch 7 step 20: [1.5429133], acc: [0.34375]
[2020-03-09 14:49:10,592.592] train.py [line:99] INFO: loss at epoch 7 step 20: [1.5429133], acc: [0.34375]
2020-03-09 14:49:15,001-INFO: loss at epoch 7 step 25: [1.5074036], acc: [0.40625]
[2020-03-09 14:49:15,001.001] train.py [line:99] INFO: loss at epoch 7 step 25: [1.5074036], acc: [0.40625]
2020-03-09 14:49:19,210-INFO: loss at epoch 7 step 30: [1.4833107], acc: [0.5]
[2020-03-09 14:49:19,210.210] train.py [line:99] INFO: loss at epoch 7 step 30: [1.4833107], acc: [0.5]
2020-03-09 14:49:23,482-INFO: loss at epoch 7 step 35: [1.4988339], acc: [0.40625]
[2020-03-09 14:49:23,482.482] train.py [line:99] INFO: loss at epoch 7 step 35: [1.4988339], acc: [0.40625]
2020-03-09 14:49:27,638-INFO: loss at epoch 7 step 40: [1.5131725], acc: [0.390625]
[2020-03-09 14:49:27,638.638] train.py [line:99] INFO: loss at epoch 7 step 40: [1.5131725], acc: [0.390625]
2020-03-09 14:49:31,932-INFO: loss at epoch 7 step 45: [1.5473073], acc: [0.390625]
[2020-03-09 14:49:31,932.932] train.py [line:99] INFO: loss at epoch 7 step 45: [1.5473073], acc: [0.390625]
2020-03-09 14:49:31,992-INFO: epoch 7 acc: [0.40726903]
[2020-03-09 14:49:31,992.992] train.py [line:102] INFO: epoch 7 acc: [0.40726903]
2020-03-09 14:49:31,992-INFO: current epoch 7 acc: [0.40726903] better than last acc: [0.40047553], save model
[2020-03-09 14:49:31,992.992] train.py [line:105] INFO: current epoch 7 acc: [0.40726903] better than last acc: [0.40047553], save model
2020-03-09 14:49:38,033-INFO: loss at epoch 8 step 5: [1.5423222], acc: [0.390625]
[2020-03-09 14:49:38,033.033] train.py [line:99] INFO: loss at epoch 8 step 5: [1.5423222], acc: [0.390625]
2020-03-09 14:49:42,362-INFO: loss at epoch 8 step 10: [1.5595949], acc: [0.328125]
[2020-03-09 14:49:42,362.362] train.py [line:99] INFO: loss at epoch 8 step 10: [1.5595949], acc: [0.328125]
2020-03-09 14:49:46,602-INFO: loss at epoch 8 step 15: [1.5497113], acc: [0.3125]
[2020-03-09 14:49:46,602.602] train.py [line:99] INFO: loss at epoch 8 step 15: [1.5497113], acc: [0.3125]
2020-03-09 14:49:51,084-INFO: loss at epoch 8 step 20: [1.5187984], acc: [0.4375]
[2020-03-09 14:49:51,084.084] train.py [line:99] INFO: loss at epoch 8 step 20: [1.5187984], acc: [0.4375]
2020-03-09 14:49:55,428-INFO: loss at epoch 8 step 25: [1.5101603], acc: [0.40625]
[2020-03-09 14:49:55,428.428] train.py [line:99] INFO: loss at epoch 8 step 25: [1.5101603], acc: [0.40625]
2020-03-09 14:49:59,692-INFO: loss at epoch 8 step 30: [1.5155348], acc: [0.375]
[2020-03-09 14:49:59,692.692] train.py [line:99] INFO: loss at epoch 8 step 30: [1.5155348], acc: [0.375]
2020-03-09 14:50:04,243-INFO: loss at epoch 8 step 35: [1.4790664], acc: [0.4375]
[2020-03-09 14:50:04,243.243] train.py [line:99] INFO: loss at epoch 8 step 35: [1.4790664], acc: [0.4375]
2020-03-09 14:50:08,540-INFO: loss at epoch 8 step 40: [1.5242894], acc: [0.421875]
[2020-03-09 14:50:08,540.540] train.py [line:99] INFO: loss at epoch 8 step 40: [1.5242894], acc: [0.421875]
2020-03-09 14:50:12,751-INFO: loss at epoch 8 step 45: [1.5246938], acc: [0.375]
[2020-03-09 14:50:12,751.751] train.py [line:99] INFO: loss at epoch 8 step 45: [1.5246938], acc: [0.375]
2020-03-09 14:50:12,789-INFO: epoch 8 acc: [0.4076087]
[2020-03-09 14:50:12,789.789] train.py [line:102] INFO: epoch 8 acc: [0.4076087]
2020-03-09 14:50:12,790-INFO: current epoch 8 acc: [0.4076087] better than last acc: [0.40726903], save model
[2020-03-09 14:50:12,790.790] train.py [line:105] INFO: current epoch 8 acc: [0.4076087] better than last acc: [0.40726903], save model
2020-03-09 14:50:18,911-INFO: loss at epoch 9 step 5: [1.5397782], acc: [0.34375]
[2020-03-09 14:50:18,911.911] train.py [line:99] INFO: loss at epoch 9 step 5: [1.5397782], acc: [0.34375]
2020-03-09 14:50:23,223-INFO: loss at epoch 9 step 10: [1.505233], acc: [0.390625]
[2020-03-09 14:50:23,223.223] train.py [line:99] INFO: loss at epoch 9 step 10: [1.505233], acc: [0.390625]
2020-03-09 14:50:27,537-INFO: loss at epoch 9 step 15: [1.4979243], acc: [0.46875]
[2020-03-09 14:50:27,537.537] train.py [line:99] INFO: loss at epoch 9 step 15: [1.4979243], acc: [0.46875]
2020-03-09 14:50:31,944-INFO: loss at epoch 9 step 20: [1.5539124], acc: [0.328125]
[2020-03-09 14:50:31,944.944] train.py [line:99] INFO: loss at epoch 9 step 20: [1.5539124], acc: [0.328125]
2020-03-09 14:50:36,305-INFO: loss at epoch 9 step 25: [1.5282992], acc: [0.34375]
[2020-03-09 14:50:36,305.305] train.py [line:99] INFO: loss at epoch 9 step 25: [1.5282992], acc: [0.34375]
2020-03-09 14:50:40,749-INFO: loss at epoch 9 step 30: [1.4891154], acc: [0.46875]
[2020-03-09 14:50:40,749.749] train.py [line:99] INFO: loss at epoch 9 step 30: [1.4891154], acc: [0.46875]
2020-03-09 14:50:44,958-INFO: loss at epoch 9 step 35: [1.4865807], acc: [0.453125]
[2020-03-09 14:50:44,958.958] train.py [line:99] INFO: loss at epoch 9 step 35: [1.4865807], acc: [0.453125]
2020-03-09 14:50:49,387-INFO: loss at epoch 9 step 40: [1.5120044], acc: [0.453125]
[2020-03-09 14:50:49,387.387] train.py [line:99] INFO: loss at epoch 9 step 40: [1.5120044], acc: [0.453125]
2020-03-09 14:50:53,848-INFO: loss at epoch 9 step 45: [1.5828803], acc: [0.265625]
[2020-03-09 14:50:53,848.848] train.py [line:99] INFO: loss at epoch 9 step 45: [1.5828803], acc: [0.265625]
2020-03-09 14:50:53,904-INFO: epoch 9 acc: [0.39945653]
[2020-03-09 14:50:53,904.904] train.py [line:102] INFO: epoch 9 acc: [0.39945653]
2020-03-09 14:50:58,967-INFO: loss at epoch 10 step 5: [1.510431], acc: [0.40625]
[2020-03-09 14:50:58,967.967] train.py [line:99] INFO: loss at epoch 10 step 5: [1.510431], acc: [0.40625]
2020-03-09 14:51:03,333-INFO: loss at epoch 10 step 10: [1.4603238], acc: [0.46875]
[2020-03-09 14:51:03,333.333] train.py [line:99] INFO: loss at epoch 10 step 10: [1.4603238], acc: [0.46875]
2020-03-09 14:51:07,609-INFO: loss at epoch 10 step 15: [1.5105753], acc: [0.34375]
[2020-03-09 14:51:07,609.609] train.py [line:99] INFO: loss at epoch 10 step 15: [1.5105753], acc: [0.34375]
2020-03-09 14:51:11,934-INFO: loss at epoch 10 step 20: [1.5301361], acc: [0.34375]
[2020-03-09 14:51:11,934.934] train.py [line:99] INFO: loss at epoch 10 step 20: [1.5301361], acc: [0.34375]
2020-03-09 14:51:16,374-INFO: loss at epoch 10 step 25: [1.4735079], acc: [0.53125]
[2020-03-09 14:51:16,374.374] train.py [line:99] INFO: loss at epoch 10 step 25: [1.4735079], acc: [0.53125]
2020-03-09 14:51:20,749-INFO: loss at epoch 10 step 30: [1.5216472], acc: [0.421875]
[2020-03-09 14:51:20,749.749] train.py [line:99] INFO: loss at epoch 10 step 30: [1.5216472], acc: [0.421875]
2020-03-09 14:51:25,160-INFO: loss at epoch 10 step 35: [1.4697297], acc: [0.453125]
[2020-03-09 14:51:25,160.160] train.py [line:99] INFO: loss at epoch 10 step 35: [1.4697297], acc: [0.453125]
2020-03-09 14:51:29,327-INFO: loss at epoch 10 step 40: [1.4734101], acc: [0.5]
[2020-03-09 14:51:29,327.327] train.py [line:99] INFO: loss at epoch 10 step 40: [1.4734101], acc: [0.5]
2020-03-09 14:51:33,684-INFO: loss at epoch 10 step 45: [1.5263293], acc: [0.421875]
[2020-03-09 14:51:33,684.684] train.py [line:99] INFO: loss at epoch 10 step 45: [1.5263293], acc: [0.421875]
2020-03-09 14:51:33,756-INFO: epoch 10 acc: [0.41202447]
[2020-03-09 14:51:33,756.756] train.py [line:102] INFO: epoch 10 acc: [0.41202447]
2020-03-09 14:51:33,756-INFO: current epoch 10 acc: [0.41202447] better than last acc: [0.4076087], save model
[2020-03-09 14:51:33,756.756] train.py [line:105] INFO: current epoch 10 acc: [0.41202447] better than last acc: [0.4076087], save model
2020-03-09 14:51:40,010-INFO: loss at epoch 11 step 5: [1.5073351], acc: [0.359375]
[2020-03-09 14:51:40,010.010] train.py [line:99] INFO: loss at epoch 11 step 5: [1.5073351], acc: [0.359375]
2020-03-09 14:51:44,365-INFO: loss at epoch 11 step 10: [1.4968119], acc: [0.390625]
[2020-03-09 14:51:44,365.365] train.py [line:99] INFO: loss at epoch 11 step 10: [1.4968119], acc: [0.390625]
2020-03-09 14:51:48,685-INFO: loss at epoch 11 step 15: [1.485255], acc: [0.484375]
[2020-03-09 14:51:48,685.685] train.py [line:99] INFO: loss at epoch 11 step 15: [1.485255], acc: [0.484375]
2020-03-09 14:51:53,106-INFO: loss at epoch 11 step 20: [1.5092535], acc: [0.421875]
[2020-03-09 14:51:53,106.106] train.py [line:99] INFO: loss at epoch 11 step 20: [1.5092535], acc: [0.421875]
2020-03-09 14:51:57,483-INFO: loss at epoch 11 step 25: [1.5008216], acc: [0.40625]
[2020-03-09 14:51:57,483.483] train.py [line:99] INFO: loss at epoch 11 step 25: [1.5008216], acc: [0.40625]
2020-03-09 14:52:01,697-INFO: loss at epoch 11 step 30: [1.4876654], acc: [0.5]
[2020-03-09 14:52:01,697.697] train.py [line:99] INFO: loss at epoch 11 step 30: [1.4876654], acc: [0.5]
2020-03-09 14:52:05,905-INFO: loss at epoch 11 step 35: [1.501628], acc: [0.375]
[2020-03-09 14:52:05,905.905] train.py [line:99] INFO: loss at epoch 11 step 35: [1.501628], acc: [0.375]
2020-03-09 14:52:10,108-INFO: loss at epoch 11 step 40: [1.521626], acc: [0.375]
[2020-03-09 14:52:10,108.108] train.py [line:99] INFO: loss at epoch 11 step 40: [1.521626], acc: [0.375]
2020-03-09 14:52:14,542-INFO: loss at epoch 11 step 45: [1.5131092], acc: [0.34375]
[2020-03-09 14:52:14,542.542] train.py [line:99] INFO: loss at epoch 11 step 45: [1.5131092], acc: [0.34375]
2020-03-09 14:52:14,591-INFO: epoch 11 acc: [0.41236413]
[2020-03-09 14:52:14,591.591] train.py [line:102] INFO: epoch 11 acc: [0.41236413]
2020-03-09 14:52:14,591-INFO: current epoch 11 acc: [0.41236413] better than last acc: [0.41202447], save model
[2020-03-09 14:52:14,591.591] train.py [line:105] INFO: current epoch 11 acc: [0.41236413] better than last acc: [0.41202447], save model
2020-03-09 14:52:20,702-INFO: loss at epoch 12 step 5: [1.4927247], acc: [0.453125]
[2020-03-09 14:52:20,702.702] train.py [line:99] INFO: loss at epoch 12 step 5: [1.4927247], acc: [0.453125]
2020-03-09 14:52:24,967-INFO: loss at epoch 12 step 10: [1.4984442], acc: [0.515625]
[2020-03-09 14:52:24,967.967] train.py [line:99] INFO: loss at epoch 12 step 10: [1.4984442], acc: [0.515625]
2020-03-09 14:52:29,087-INFO: loss at epoch 12 step 15: [1.5027884], acc: [0.4375]
[2020-03-09 14:52:29,087.087] train.py [line:99] INFO: loss at epoch 12 step 15: [1.5027884], acc: [0.4375]
2020-03-09 14:52:33,287-INFO: loss at epoch 12 step 20: [1.5274079], acc: [0.328125]
[2020-03-09 14:52:33,287.287] train.py [line:99] INFO: loss at epoch 12 step 20: [1.5274079], acc: [0.328125]
2020-03-09 14:52:37,659-INFO: loss at epoch 12 step 25: [1.5048127], acc: [0.359375]
[2020-03-09 14:52:37,659.659] train.py [line:99] INFO: loss at epoch 12 step 25: [1.5048127], acc: [0.359375]
2020-03-09 14:52:41,805-INFO: loss at epoch 12 step 30: [1.4676807], acc: [0.4375]
[2020-03-09 14:52:41,805.805] train.py [line:99] INFO: loss at epoch 12 step 30: [1.4676807], acc: [0.4375]
2020-03-09 14:52:45,836-INFO: loss at epoch 12 step 35: [1.5093656], acc: [0.359375]
[2020-03-09 14:52:45,836.836] train.py [line:99] INFO: loss at epoch 12 step 35: [1.5093656], acc: [0.359375]
2020-03-09 14:52:50,167-INFO: loss at epoch 12 step 40: [1.5140204], acc: [0.40625]
[2020-03-09 14:52:50,167.167] train.py [line:99] INFO: loss at epoch 12 step 40: [1.5140204], acc: [0.40625]
2020-03-09 14:52:54,464-INFO: loss at epoch 12 step 45: [1.4695578], acc: [0.515625]
[2020-03-09 14:52:54,464.464] train.py [line:99] INFO: loss at epoch 12 step 45: [1.4695578], acc: [0.515625]
2020-03-09 14:52:54,509-INFO: epoch 12 acc: [0.41949728]
[2020-03-09 14:52:54,509.509] train.py [line:102] INFO: epoch 12 acc: [0.41949728]
2020-03-09 14:52:54,510-INFO: current epoch 12 acc: [0.41949728] better than last acc: [0.41236413], save model
[2020-03-09 14:52:54,510.510] train.py [line:105] INFO: current epoch 12 acc: [0.41949728] better than last acc: [0.41236413], save model
2020-03-09 14:53:00,663-INFO: loss at epoch 13 step 5: [1.5057447], acc: [0.4375]
[2020-03-09 14:53:00,663.663] train.py [line:99] INFO: loss at epoch 13 step 5: [1.5057447], acc: [0.4375]
2020-03-09 14:53:04,649-INFO: loss at epoch 13 step 10: [1.5863025], acc: [0.21875]
[2020-03-09 14:53:04,649.649] train.py [line:99] INFO: loss at epoch 13 step 10: [1.5863025], acc: [0.21875]
2020-03-09 14:53:08,991-INFO: loss at epoch 13 step 15: [1.4967599], acc: [0.4375]
[2020-03-09 14:53:08,991.991] train.py [line:99] INFO: loss at epoch 13 step 15: [1.4967599], acc: [0.4375]
2020-03-09 14:53:13,356-INFO: loss at epoch 13 step 20: [1.4967403], acc: [0.390625]
[2020-03-09 14:53:13,356.356] train.py [line:99] INFO: loss at epoch 13 step 20: [1.4967403], acc: [0.390625]
2020-03-09 14:53:17,665-INFO: loss at epoch 13 step 25: [1.4900951], acc: [0.40625]
[2020-03-09 14:53:17,665.665] train.py [line:99] INFO: loss at epoch 13 step 25: [1.4900951], acc: [0.40625]
2020-03-09 14:53:21,980-INFO: loss at epoch 13 step 30: [1.5185156], acc: [0.359375]
[2020-03-09 14:53:21,980.980] train.py [line:99] INFO: loss at epoch 13 step 30: [1.5185156], acc: [0.359375]
2020-03-09 14:53:26,219-INFO: loss at epoch 13 step 35: [1.5234725], acc: [0.359375]
[2020-03-09 14:53:26,219.219] train.py [line:99] INFO: loss at epoch 13 step 35: [1.5234725], acc: [0.359375]
2020-03-09 14:53:30,646-INFO: loss at epoch 13 step 40: [1.5520103], acc: [0.375]
[2020-03-09 14:53:30,646.646] train.py [line:99] INFO: loss at epoch 13 step 40: [1.5520103], acc: [0.375]
2020-03-09 14:53:34,713-INFO: loss at epoch 13 step 45: [1.4575856], acc: [0.515625]
[2020-03-09 14:53:34,713.713] train.py [line:99] INFO: loss at epoch 13 step 45: [1.4575856], acc: [0.515625]
2020-03-09 14:53:34,773-INFO: epoch 13 acc: [0.4232337]
[2020-03-09 14:53:34,773.773] train.py [line:102] INFO: epoch 13 acc: [0.4232337]
2020-03-09 14:53:34,773-INFO: current epoch 13 acc: [0.4232337] better than last acc: [0.41949728], save model
[2020-03-09 14:53:34,773.773] train.py [line:105] INFO: current epoch 13 acc: [0.4232337] better than last acc: [0.41949728], save model
2020-03-09 14:53:40,903-INFO: loss at epoch 14 step 5: [1.4966567], acc: [0.46875]
[2020-03-09 14:53:40,903.903] train.py [line:99] INFO: loss at epoch 14 step 5: [1.4966567], acc: [0.46875]
2020-03-09 14:53:45,142-INFO: loss at epoch 14 step 10: [1.5125706], acc: [0.375]
[2020-03-09 14:53:45,142.142] train.py [line:99] INFO: loss at epoch 14 step 10: [1.5125706], acc: [0.375]
2020-03-09 14:53:49,461-INFO: loss at epoch 14 step 15: [1.4819767], acc: [0.453125]
[2020-03-09 14:53:49,461.461] train.py [line:99] INFO: loss at epoch 14 step 15: [1.4819767], acc: [0.453125]
2020-03-09 14:53:53,821-INFO: loss at epoch 14 step 20: [1.5196563], acc: [0.390625]
[2020-03-09 14:53:53,821.821] train.py [line:99] INFO: loss at epoch 14 step 20: [1.5196563], acc: [0.390625]
2020-03-09 14:53:57,946-INFO: loss at epoch 14 step 25: [1.5014596], acc: [0.46875]
[2020-03-09 14:53:57,946.946] train.py [line:99] INFO: loss at epoch 14 step 25: [1.5014596], acc: [0.46875]
2020-03-09 14:54:02,088-INFO: loss at epoch 14 step 30: [1.5548491], acc: [0.25]
[2020-03-09 14:54:02,088.088] train.py [line:99] INFO: loss at epoch 14 step 30: [1.5548491], acc: [0.25]
2020-03-09 14:54:06,231-INFO: loss at epoch 14 step 35: [1.4741466], acc: [0.4375]
[2020-03-09 14:54:06,231.231] train.py [line:99] INFO: loss at epoch 14 step 35: [1.4741466], acc: [0.4375]
2020-03-09 14:54:10,528-INFO: loss at epoch 14 step 40: [1.5244324], acc: [0.4375]
[2020-03-09 14:54:10,528.528] train.py [line:99] INFO: loss at epoch 14 step 40: [1.5244324], acc: [0.4375]
2020-03-09 14:54:14,796-INFO: loss at epoch 14 step 45: [1.4294813], acc: [0.53125]
[2020-03-09 14:54:14,796.796] train.py [line:99] INFO: loss at epoch 14 step 45: [1.4294813], acc: [0.53125]
2020-03-09 14:54:14,855-INFO: epoch 14 acc: [0.43036684]
[2020-03-09 14:54:14,855.855] train.py [line:102] INFO: epoch 14 acc: [0.43036684]
2020-03-09 14:54:14,856-INFO: current epoch 14 acc: [0.43036684] better than last acc: [0.4232337], save model
[2020-03-09 14:54:14,856.856] train.py [line:105] INFO: current epoch 14 acc: [0.43036684] better than last acc: [0.4232337], save model
2020-03-09 14:54:15,863-INFO: train till end
[2020-03-09 14:54:15,863.863] train.py [line:110] INFO: train till end
In[11]
# 使用验证集对训练好的模型效果进行验证,并输出在整个验证集上的准确率
!python work/eval.py
[2020-03-09 14:54:48,210.210] config.py [line:85] INFO: input_size: [3, 224, 224]
[2020-03-09 14:54:48,210.210] config.py [line:86] INFO: class_dim: 5
[2020-03-09 14:54:48,210.210] config.py [line:87] INFO: continue_train: True
[2020-03-09 14:54:48,210.210] config.py [line:88] INFO: train_image_count: 2950
[2020-03-09 14:54:48,210.210] config.py [line:89] INFO: eval_image_count: 720
[2020-03-09 14:54:48,210.210] config.py [line:90] INFO: num_epochs: 15
[2020-03-09 14:54:48,210.210] config.py [line:91] INFO: train_batch_size: 64
[2020-03-09 14:54:48,210.210] config.py [line:92] INFO: mean_rgb: [127.5, 127.5, 127.5]
[2020-03-09 14:54:48,210.210] config.py [line:93] INFO: save_model_dir: ./save_dir/model
[2020-03-09 14:54:48,211.211] eval.py [line:16] INFO: start eval
W0309 14:54:49.596622   582 device_context.cc:237] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 10.1, Runtime API Version: 9.0
W0309 14:54:49.600636   582 device_context.cc:245] device: 0, cuDNN Version: 7.3.
[2020-03-09 14:55:05,105.105] eval.py [line:45] INFO: test count: 720 , acc: 0.43611112236976624 cost time: 13.941327571868896
In[13]
!python work/infer.py
2020-03-09 14:56:17,481-INFO: input_size: [3, 224, 224]
[2020-03-09 14:56:17,481.481] config.py [line:85] INFO: input_size: [3, 224, 224]
2020-03-09 14:56:17,482-INFO: class_dim: 5
[2020-03-09 14:56:17,482.482] config.py [line:86] INFO: class_dim: 5
2020-03-09 14:56:17,482-INFO: continue_train: True
[2020-03-09 14:56:17,482.482] config.py [line:87] INFO: continue_train: True
2020-03-09 14:56:17,482-INFO: train_image_count: 2950
[2020-03-09 14:56:17,482.482] config.py [line:88] INFO: train_image_count: 2950
2020-03-09 14:56:17,482-INFO: eval_image_count: 720
[2020-03-09 14:56:17,482.482] config.py [line:89] INFO: eval_image_count: 720
2020-03-09 14:56:17,482-INFO: num_epochs: 15
[2020-03-09 14:56:17,482.482] config.py [line:90] INFO: num_epochs: 15
2020-03-09 14:56:17,482-INFO: train_batch_size: 64
[2020-03-09 14:56:17,482.482] config.py [line:91] INFO: train_batch_size: 64
2020-03-09 14:56:17,482-INFO: mean_rgb: [127.5, 127.5, 127.5]
[2020-03-09 14:56:17,482.482] config.py [line:92] INFO: mean_rgb: [127.5, 127.5, 127.5]
2020-03-09 14:56:17,482-INFO: save_model_dir: ./save_dir/model
[2020-03-09 14:56:17,482.482] config.py [line:93] INFO: save_model_dir: ./save_dir/model
2020-03-09 14:56:17,494-INFO: input_size: [3, 224, 224]
[2020-03-09 14:56:17,494.494] config.py [line:85] INFO: input_size: [3, 224, 224]
2020-03-09 14:56:17,494-INFO: class_dim: 5
[2020-03-09 14:56:17,494.494] config.py [line:86] INFO: class_dim: 5
2020-03-09 14:56:17,494-INFO: continue_train: True
[2020-03-09 14:56:17,494.494] config.py [line:87] INFO: continue_train: True
2020-03-09 14:56:17,494-INFO: train_image_count: 2950
[2020-03-09 14:56:17,494.494] config.py [line:88] INFO: train_image_count: 2950
2020-03-09 14:56:17,494-INFO: eval_image_count: 720
[2020-03-09 14:56:17,494.494] config.py [line:89] INFO: eval_image_count: 720
2020-03-09 14:56:17,495-INFO: num_epochs: 15
[2020-03-09 14:56:17,495.495] config.py [line:90] INFO: num_epochs: 15
2020-03-09 14:56:17,495-INFO: train_batch_size: 64
[2020-03-09 14:56:17,495.495] config.py [line:91] INFO: train_batch_size: 64
2020-03-09 14:56:17,495-INFO: mean_rgb: [127.5, 127.5, 127.5]
[2020-03-09 14:56:17,495.495] config.py [line:92] INFO: mean_rgb: [127.5, 127.5, 127.5]
2020-03-09 14:56:17,495-INFO: save_model_dir: ./save_dir/model
[2020-03-09 14:56:17,495.495] config.py [line:93] INFO: save_model_dir: ./save_dir/model
W0309 14:56:18.848448   702 device_context.cc:237] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 10.1, Runtime API Version: 9.0
W0309 14:56:18.851882   702 device_context.cc:245] device: 0, cuDNN Version: 7.3.
checkpoint loaded
image data/data2815/sunflowers/14646283472_50a3ae1395.jpg Infer result is: sunflowers

 点击链接,使用AI Studio一键上手实践项目吧:https://aistudio.baidu.com/aistudio/projectdetail/169436

下载安装命令

## CPU版本安装命令
pip install -f https://paddlepaddle.org.cn/pip/oschina/cpu paddlepaddle

## GPU版本安装命令
pip install -f https://paddlepaddle.org.cn/pip/oschina/gpu paddlepaddle-gpu

>> 访问 PaddlePaddle 官网,了解更多相关内容

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部