Giter Site home page Giter Site logo

tensorflow_models_learning's Introduction

tensorflow_models_learning

老铁要是觉得不错,给个“star”

1.生成record训练数据

dataset已经包含了训练和测试的图片,请直接运行create_tf_record.py

对于InceptionNet V1:设置resize_height和resize_width = 224
对于InceptionNet V3:设置resize_height和resize_width = 299
其他模型,请根据输入需要设置resize_height和resize_width的大小

if __name__ == '__main__':
    # 参数设置
    resize_height = 224  # 指定存储图片高度
    resize_width = 224  # 指定存储图片宽度
    shuffle=True
    log=5
    # 产生train.record文件
    image_dir='dataset/train'
    train_labels = 'dataset/train.txt'  # 图片路径
    train_record_output = 'dataset/record/train{}.tfrecords'.format(resize_height)
    create_records(image_dir,train_labels, train_record_output, resize_height, resize_width,shuffle,log)
    train_nums=get_example_nums(train_record_output)
    print("save train example nums={}".format(train_nums))

    # 产生val.record文件
    image_dir='dataset/val'
    val_labels = 'dataset/val.txt'  # 图片路径
    val_record_output = 'dataset/record/val{}.tfrecords'.format(resize_height)
    create_records(image_dir,val_labels, val_record_output, resize_height, resize_width,shuffle,log)
    val_nums=get_example_nums(val_record_output)
    print("save val example nums={}".format(val_nums))

    # 测试显示函数
    # disp_records(train_record_output,resize_height, resize_width)
    batch_test(train_record_output,resize_height, resize_width)

2.训练过程

目前提供VGG、inception_v1、inception_v3、mobilenet_v以及resnet_v1的训练文件,只需要生成tfrecord数据,即可开始训练

训练VGG请直接运行:vgg_train_val.py
训练inception_v1请直接运行:inception_v1_train_val.py
训练inception_v3请直接运行:inception_v3_train_val.py
训练mobilenet_v1请直接运行:mobilenet_train_val.py
其他模型,请参考训练文件进行修改

3.资源下载

  • 本项目详细说明,请参考鄙人博客资料:

《使用自己的数据集训练GoogLenet InceptionNet V1 V2 V3模型》: https://panjinquan.blog.csdn.net/article/details/81560537
《tensorflow实现将ckpt转pb文件》: https://panjinquan.blog.csdn.net/article/details/82218092
《使用自己的数据集训练MobileNet、ResNet实现图像分类(TensorFlow)》https://panjinquan.blog.csdn.net/article/details/88252699 预训练模型下载地址: https://download.csdn.net/download/guyuealian/10610847

  • 老铁要是觉得不错,给个“star”
  • tensorflow-gpu==1.4.0

tensorflow_models_learning's People

Contributors

panjinquan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorflow_models_learning's Issues

如何修改输入节点

ckpt转pb的时候,因为所保存的ckpt文件使用batch方式训练,所以所转换的bp模型的最开始的两个节点为FIFOQueueV2和QueueDequeueManyV2, 如何把修改这个pb模型的输入节点呢,我想把输入改为input(image)这样。

报错如何修改?

    for lines in lines_list:
        line=lines.rstrip().split(' ')
        label=[]
        for i in range(labels_num):
            label.append(int(line[i+1]))
        images.append(line[0])
        labels.append(label)

File "/home/admin-pc/Documents/tensorflow_models_learning-master/create_tf_record.py", line 77, in load_labels_file
label.append(int(line[i+1]))
ValueError: invalid literal for int() with base 10: ''

输入/输出节点

请问convert_pb文件中的input_image_tensor、input_keep_prob_tensor、input_is_training_tensor、output_tensor_name如何确定,freeze_graph函数中for op 打印出来的没有这几个值,ckpt文件的计算图输出也没有这几个值?

create_tf_record.py

Traceback (most recent call last):
File "/home/z/tensorflow_models_learning-master/create_tf_record.py", line 303, in
train_nums=get_example_nums(train_record_output)
File "/home/z/tensorflow_models_learning-master/create_tf_record.py", line 39, in get_example_nums
for record in tf.python_io.tf_record_iterator(tf_records_filenames):
File "/home/z/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/lib/io/tf_record.py", line 174, in tf_record_iterator
compat.as_bytes(path), 0, compat.as_bytes(compression_type), status)
File "/home/z/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /home/z/tensorflow_models_learning-master/dataset/record/train224.tfrecords; No such file or directory

博主,总是出现这个错误是怎么了?

为什么loss一直为0,精度一直为1,训练的是inception_v1

2019-11-27 22:04:34.371258: Step [0] train Loss : 0.000000, training accuracy : 1
2019-11-27 22:04:57.633260: Step [0] val Loss : 0.000000, val accuracy : 1
------save:models\best_models_0_1.0000.ckpt
2019-11-27 22:05:36.576254: Step [10] train Loss : 0.000000, training accuracy : 1
2019-11-27 22:06:12.278251: Step [20] train Loss : 0.000000, training accuracy : 1
2019-11-27 22:06:32.546254: Step [20] val Loss : 0.000000, val accuracy : 1
........

单张图片测试时,所有图片预测结果相同

用自己训练好的模型测试,在测试集上单张图片测试结果相同。
拿之前的验证集测试,如果batch size设为1 预测结果同测试集一样,都是以同样的概率预测为同一个类别,但batch size不为1 比如调整为64 模型就预测正常,这是为什么呢

loss

运行训练代码时报错如上,请问应该如何解决

恳请请教,Froze ERROR!

想跟你请教,根据你的方法或代码保存后,我再导入后缀为meta图并赋予ckpt中的参数,是可以正常跑预测的。但是forzen为pb文件时就报‘INFO:tensorflow:Froze 0 variables.INFO:tensorflow:Converted 0 variables to const ops.’,并且,导入pb文件,再运用预测就会报缺少XX之类的错误。恳请指教,谢谢!

分类63个但是精度无法提高 感觉问题比较大

2020-11-02 15:37:57.208234: Step [0] train Loss : 4.451777, training accuracy : 0.1875
2020-11-02 15:38:42.723464: Step [0] val Loss : 4.219480, val accuracy : 0.0174923
2020-11-02 15:38:55.136853: Step [100] train Loss : 3.162268, training accuracy : 0
2020-11-02 15:39:07.425743: Step [200] train Loss : 1.888495, training accuracy : 0
2020-11-02 15:39:53.201844: Step [200] val Loss : 13.010412, val accuracy : 0.0197906
2020-11-02 15:40:05.477731: Step [300] train Loss : 1.710598, training accuracy : 0
2020-11-02 15:40:17.726494: Step [400] train Loss : 2.285333, training accuracy : 0.125
2020-11-02 15:41:03.523871: Step [400] val Loss : 9.567571, val accuracy : 0.0194076
2020-11-02 15:41:15.935632: Step [500] train Loss : 0.689892, training accuracy : 0
2020-11-02 15:41:28.475818: Step [600] train Loss : 0.531735, training accuracy : 0
2020-11-02 15:42:14.895427: Step [600] val Loss : 10.680215, val accuracy : 0.0190245
2020-11-02 15:42:27.410021: Step [700] train Loss : 0.294478, training accuracy : 0
2020-11-02 15:42:39.976662: Step [800] train Loss : 0.587241, training accuracy : 0
2020-11-02 15:43:26.770598: Step [800] val Loss : 7.437372, val accuracy : 0.0190245
2020-11-02 15:43:39.309107: Step [900] train Loss : 0.352322, training accuracy : 0
2020-11-02 15:43:51.995333: Step [1000] train Loss : 0.210653, training accuracy : 0
2020-11-02 15:44:39.661366: Step [1000] val Loss : 7.019403, val accuracy : 0.0190245
2020-11-02 15:44:52.410022: Step [1100] train Loss : 0.054857, training accuracy : 0
2020-11-02 15:45:05.355245: Step [1200] train Loss : 0.053495, training accuracy : 0
2020-11-02 15:45:52.886870: Step [1200] val Loss : 6.476278, val accuracy : 0.0190245
2020-11-02 15:46:05.563014: Step [1300] train Loss : 0.017112, training accuracy : 0.0625
2020-11-02 15:46:18.331558: Step [1400] train Loss : 0.276403, training accuracy : 0
2020-11-02 15:47:05.632001: Step [1400] val Loss : 5.955071, val accuracy : 0.0190245
2020-11-02 15:47:18.504530: Step [1500] train Loss : 0.018878, training accuracy : 0
2020-11-02 15:47:31.372758: Step [1600] train Loss : 0.059408, training accuracy : 0
2020-11-02 15:48:18.951162: Step [1600] val Loss : 5.360252, val accuracy : 0.0190245
2020-11-02 15:48:31.887936: Step [1700] train Loss : 0.028561, training accuracy : 0
2020-11-02 15:48:44.865589: Step [1800] train Loss : 0.008514, training accuracy : 0
2020-11-02 15:49:32.827837: Step [1800] val Loss : 4.431525, val accuracy : 0.0194076
2020-11-02 15:49:45.732202: Step [1900] train Loss : 0.191928, training accuracy : 0
2020-11-02 15:49:59.040962: Step [2000] train Loss : 0.014791, training accuracy : 0.0625
2020-11-02 15:50:46.432237: Step [2000] val Loss : 4.476066, val accuracy : 0.0190245
-----save:models/model.ckpt-2000
2020-11-02 15:51:00.828174: Step [2100] train Loss : 0.010766, training accuracy : 0.0625
2020-11-02 15:51:13.764994: Step [2200] train Loss : 0.085822, training accuracy : 0
2020-11-02 15:52:00.938146: Step [2200] val Loss : 4.355613, val accuracy : 0.0110444
2020-11-02 15:52:13.771588: Step [2300] train Loss : 0.119277, training accuracy : 0
2020-11-02 15:52:26.567043: Step [2400] train Loss : 0.024402, training accuracy : 0
2020-11-02 15:53:14.222747: Step [2400] val Loss : 4.345027, val accuracy : 0.0193437
2020-11-02 15:53:27.150898: Step [2500] train Loss : 0.050773, training accuracy : 0
2020-11-02 15:53:39.925711: Step [2600] train Loss : 0.006547, training accuracy : 0
2020-11-02 15:54:27.511248: Step [2600] val Loss : 4.385560, val accuracy : 0.0111721
2020-11-02 15:54:40.305635: Step [2700] train Loss : 0.011848, training accuracy : 0
2020-11-02 15:54:53.234307: Step [2800] train Loss : 0.012595, training accuracy : 0
2020-11-02 15:55:41.143845: Step [2800] val Loss : 4.392406, val accuracy : 0.0110444
2020-11-02 15:55:53.962262: Step [2900] train Loss : 0.018239, training accuracy : 0
2020-11-02 15:56:06.990641: Step [3000] train Loss : 0.067942, training accuracy : 0
2020-11-02 15:56:54.403528: Step [3000] val Loss : 4.526069, val accuracy : 0.0106614
2020-11-02 15:57:07.287715: Step [3100] train Loss : 0.002908, training accuracy : 0
2020-11-02 15:57:20.071291: Step [3200] train Loss : 0.015377, training accuracy : 0
2020-11-02 15:58:07.453693: Step [3200] val Loss : 4.584523, val accuracy : 0.0180031
2020-11-02 15:58:20.484154: Step [3300] train Loss : 0.003488, training accuracy : 0
2020-11-02 15:58:33.126986: Step [3400] train Loss : 0.077828, training accuracy : 0
2020-11-02 15:59:20.953589: Step [3400] val Loss : 4.706525, val accuracy : 0.0118105
2020-11-02 15:59:33.913899: Step [3500] train Loss : 0.002673, training accuracy : 0.0625
2020-11-02 15:59:46.716906: Step [3600] train Loss : 0.086050, training accuracy : 0
2020-11-02 16:00:34.343889: Step [3600] val Loss : 4.733990, val accuracy : 0.0178115
2020-11-02 16:00:47.121723: Step [3700] train Loss : 0.000803, training accuracy : 0
2020-11-02 16:01:00.026031: Step [3800] train Loss : 0.004648, training accuracy : 0.0625
2020-11-02 16:01:47.546183: Step [3800] val Loss : 4.868133, val accuracy : 0.0179392
2020-11-02 16:02:00.286305: Step [3900] train Loss : 0.002961, training accuracy : 0.125
2020-11-02 16:02:13.520870: Step [4000] train Loss : 0.083561, training accuracy : 0.0625
2020-11-02 16:03:00.840206: Step [4000] val Loss : 5.280580, val accuracy : 0.0179392
-----save:models/model.ckpt-4000
2020-11-02 16:03:14.624543: Step [4100] train Loss : 0.028515, training accuracy : 0
2020-11-02 16:03:27.654577: Step [4200] train Loss : 0.083428, training accuracy : 0
2020-11-02 16:04:15.113641: Step [4200] val Loss : 5.515779, val accuracy : 0.0179392
2020-11-02 16:04:28.035244: Step [4300] train Loss : 0.006602, training accuracy : 0.0625
2020-11-02 16:04:41.012877: Step [4400] train Loss : 0.005454, training accuracy : 0
2020-11-02 16:05:28.710228: Step [4400] val Loss : 4.986513, val accuracy : 0.0162794
2020-11-02 16:05:41.649157: Step [4500] train Loss : 0.117655, training accuracy : 0
2020-11-02 16:05:54.546338: Step [4600] train Loss : 0.008130, training accuracy : 0
2020-11-02 16:06:43.125019: Step [4600] val Loss : 5.318214, val accuracy : 0.0138534
2020-11-02 16:06:56.144484: Step [4700] train Loss : 0.198717, training accuracy : 0
2020-11-02 16:07:09.052229: Step [4800] train Loss : 0.166929, training accuracy : 0
2020-11-02 16:07:56.452739: Step [4800] val Loss : 5.759774, val accuracy : 0.0183861
2020-11-02 16:08:09.284685: Step [4900] train Loss : 0.001290, training accuracy : 0.0625
2020-11-02 16:08:22.219911: Step [5000] train Loss : 0.037633, training accuracy : 0.0625
2020-11-02 16:09:10.040866: Step [5000] val Loss : 6.110466, val accuracy : 0.0179392
2020-11-02 16:09:22.748253: Step [5100] train Loss : 0.047009, training accuracy : 0.0625
2020-11-02 16:09:35.874876: Step [5200] train Loss : 0.107128, training accuracy : 0
2020-11-02 16:10:23.152308: Step [5200] val Loss : 6.624900, val accuracy : 0.0179392
2020-11-02 16:10:36.051775: Step [5300] train Loss : 0.085515, training accuracy : 0.0625
2020-11-02 16:10:48.866156: Step [5400] train Loss : 0.409375, training accuracy : 0
2020-11-02 16:11:36.761074: Step [5400] val Loss : 6.839243, val accuracy : 0.0263023
2020-11-02 16:11:49.638604: Step [5500] train Loss : 0.074292, training accuracy : 0.0625
2020-11-02 16:12:02.772029: Step [5600] train Loss : 0.015727, training accuracy : 0
2020-11-02 16:12:50.155442: Step [5600] val Loss : 6.886412, val accuracy : 0.0256639
2020-11-02 16:13:02.860564: Step [5700] train Loss : 0.011184, training accuracy : 0
2020-11-02 16:13:15.807399: Step [5800] train Loss : 0.105041, training accuracy : 0.0625
2020-11-02 16:14:02.974487: Step [5800] val Loss : 6.774150, val accuracy : 0.0195352
2020-11-02 16:14:15.964116: Step [5900] train Loss : 0.006180, training accuracy : 0
2020-11-02 16:14:28.860469: Step [6000] train Loss : 0.002312, training accuracy : 0
2020-11-02 16:15:16.336347: Step [6000] val Loss : 6.687222, val accuracy : 0.0291113
-----save:models/model.ckpt-6000
2020-11-02 16:15:30.259542: Step [6100] train Loss : 0.000506, training accuracy : 0
2020-11-02 16:15:42.874291: Step [6200] train Loss : 0.002289, training accuracy : 0.0625
2020-11-02 16:16:30.261237: Step [6200] val Loss : 7.348487, val accuracy : 0.0201736
2020-11-02 16:16:43.067244: Step [6300] train Loss : 0.007106, training accuracy : 0.125
2020-11-02 16:16:56.013800: Step [6400] train Loss : 0.000544, training accuracy : 0
2020-11-02 16:17:43.874414: Step [6400] val Loss : 7.402358, val accuracy : 0.0302605
2020-11-02 16:17:56.692698: Step [6500] train Loss : 0.012519, training accuracy : 0
2020-11-02 16:18:09.608623: Step [6600] train Loss : 0.020444, training accuracy : 0.0625
2020-11-02 16:18:57.944717: Step [6600] val Loss : 7.957761, val accuracy : 0.032048
2020-11-02 16:19:10.604547: Step [6700] train Loss : 0.057993, training accuracy : 0.125
2020-11-02 16:19:23.401778: Step [6800] train Loss : 0.062361, training accuracy : 0
2020-11-02 16:20:10.866427: Step [6800] val Loss : 6.631777, val accuracy : 0.0329418
2020-11-02 16:20:23.524615: Step [6900] train Loss : 0.028056, training accuracy : 0
2020-11-02 16:20:36.328313: Step [7000] train Loss : 0.002315, training accuracy : 0
2020-11-02 16:21:23.668482: Step [7000] val Loss : 10.059795, val accuracy : 0.0365807
2020-11-02 16:21:36.660421: Step [7100] train Loss : 0.001399, training accuracy : 0.0625
2020-11-02 16:21:50.029407: Step [7200] train Loss : 0.044736, training accuracy : 0.0625
2020-11-02 16:22:37.962835: Step [7200] val Loss : 9.027893, val accuracy : 0.036453
2020-11-02 16:22:50.644555: Step [7300] train Loss : 0.002088, training accuracy : 0
2020-11-02 16:23:03.500411: Step [7400] train Loss : 0.001914, training accuracy : 0
2020-11-02 16:23:50.540379: Step [7400] val Loss : 9.877556, val accuracy : 0.0377937
2020-11-02 16:24:03.278654: Step [7500] train Loss : 0.010749, training accuracy : 0.0625
2020-11-02 16:24:15.917410: Step [7600] train Loss : 0.000708, training accuracy : 0
2020-11-02 16:25:03.002879: Step [7600] val Loss : 6.635362, val accuracy : 0.0444969
2020-11-02 16:25:15.709085: Step [7700] train Loss : 0.001703, training accuracy : 0
2020-11-02 16:25:28.378377: Step [7800] train Loss : 0.000629, training accuracy : 0.0625
2020-11-02 16:26:15.486690: Step [7800] val Loss : 6.803297, val accuracy : 0.0425179
2020-11-02 16:26:28.027219: Step [7900] train Loss : 0.061680, training accuracy : 0
2020-11-02 16:26:40.677709: Step [8000] train Loss : 0.002516, training accuracy : 0
2020-11-02 16:27:27.783940: Step [8000] val Loss : 6.278635, val accuracy : 0.0385598
-----save:models/model.ckpt-8000
2020-11-02 16:27:41.331630: Step [8100] train Loss : 0.001402, training accuracy : 0.0625
2020-11-02 16:27:54.020844: Step [8200] train Loss : 0.001184, training accuracy : 0.1875
2020-11-02 16:28:41.079053: Step [8200] val Loss : 4.479759, val accuracy : 0.0701609
2020-11-02 16:28:53.780333: Step [8300] train Loss : 0.000839, training accuracy : 0
2020-11-02 16:29:06.536083: Step [8400] train Loss : 0.001597, training accuracy : 0.0625
2020-11-02 16:29:53.773071: Step [8400] val Loss : 4.883051, val accuracy : 0.0725868
2020-11-02 16:30:06.546049: Step [8500] train Loss : 0.013211, training accuracy : 0.0625
2020-11-02 16:30:19.321398: Step [8600] train Loss : 0.004649, training accuracy : 0
2020-11-02 16:31:06.456382: Step [8600] val Loss : 8.681377, val accuracy : 0.0537538
2020-11-02 16:31:19.036534: Step [8700] train Loss : 0.006653, training accuracy : 0.125
2020-11-02 16:31:31.854400: Step [8800] train Loss : 0.002683, training accuracy : 0
2020-11-02 16:32:18.938620: Step [8800] val Loss : 4.728459, val accuracy : 0.104635
2020-11-02 16:32:31.707159: Step [8900] train Loss : 0.020025, training accuracy : 0.125
2020-11-02 16:32:44.462050: Step [9000] train Loss : 0.008877, training accuracy : 0.0625
2020-11-02 16:33:31.752998: Step [9000] val Loss : 3.812795, val accuracy : 0.199694
2020-11-02 16:33:44.462998: Step [9100] train Loss : 0.001572, training accuracy : 0.1875
2020-11-02 16:33:57.337466: Step [9200] train Loss : 0.005766, training accuracy : 0.125
2020-11-02 16:34:44.460697: Step [9200] val Loss : 3.064202, val accuracy : 0.234359
2020-11-02 16:34:57.289857: Step [9300] train Loss : 0.001191, training accuracy : 0
2020-11-02 16:35:09.949805: Step [9400] train Loss : 0.003511, training accuracy : 0.1875
2020-11-02 16:35:57.668908: Step [9400] val Loss : 2.668586, val accuracy : 0.291433
2020-11-02 16:36:10.336091: Step [9500] train Loss : 0.030213, training accuracy : 0.625
2020-11-02 16:36:23.274206: Step [9600] train Loss : 0.000295, training accuracy : 0.875
2020-11-02 16:37:11.567725: Step [9600] val Loss : 1.537270, val accuracy : 0.569523
2020-11-02 16:37:24.354095: Step [9700] train Loss : 0.000855, training accuracy : 0.5
2020-11-02 16:37:37.440869: Step [9800] train Loss : 0.000576, training accuracy : 0.625
2020-11-02 16:38:24.862105: Step [9800] val Loss : 1.792353, val accuracy : 0.449694
2020-11-02 16:38:37.705421: Step [9900] train Loss : 0.137523, training accuracy : 0.625
2020-11-02 16:38:51.008138: Step [10000] train Loss : 0.000887, training accuracy : 0.8125
2020-11-02 16:39:38.602564: Step [10000] val Loss : 1.078526, val accuracy : 0.668156
-----save:models/model.ckpt-10000

如何训练mobilenet——v2模型

修改代码直接调用会有bug
修改如下:
with tf.contrib.slim.arg_scope(mobilenet_v2.training_scope()):
out, endpoints = mobilenet_v2.mobilenet(input_tensor=input_images)

BUG如下:
Traceback (most recent call last):
File "train_v2.py", line 213, in
snapshot_prefix=snapshot_prefix)
File "train_v2.py", line 158, in train
tf.losses.softmax_cross_entropy(onehot_labels=input_labels, logits=out)
File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/ops/losses/losses_impl.py", line 732, in softmax_cross_entropy
logits.get_shape().assert_is_compatible_with(onehot_labels.get_shape())
File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py", line 764, in assert_is_compatible_with
raise ValueError("Shapes %s and %s are incompatible" % (self, other))
ValueError: Shapes (?, 1001) and (?, 4) are incompatible

老哥给个模型吧

我只想用googleNet V3模型做一个特征提取,我的数据也没有标签,所以不能训练,请老哥给个模型下载链接,我的邮箱是[email protected],多谢了

您好,用您预测的代码加载不了训练好的模型,查了好久也查不出来

NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Key InceptionV3/AuxLogits/Conv2d_1b_1x1/BatchNorm/beta not found in checkpoint
[[Node: save_1/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_INT64], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]
[[Node: save_1/RestoreV2/_307 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_312_save_1/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]

Performance issue in /slim/datasets (by P3)

Hello! I've found a performance issue in download_and_convert_cifar10.py: with tf.Session('') as sess(here) is defined in the function _add_to_tfrecord(here) which is repeatedly called in the loop for i in range(_NUM_TRAIN_FILES)(here).

tf.Session being defined repeatedly could lead to incremental overhead. If you define tf.Session out of the loop and pass tf.Session as a parameter to the loop, your program would be much more efficient. Here is the Stack Overflow post to support it.

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

如何在tf2.0下运行inception_v3_train_val.py

修改inception_v3_train_val.py 增加
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
试着在tf2.0下运行,提示错误
import slim.nets.inception_v3 as inception_v3
from nets import inception_utils
AttributeError: module 'tensorflow' has no attribute 'contrib'
contrib已经在2.0中移除,这三个库怎么导入?
多谢!

您好,用您预测的代码加载不了训练好的模型,查了好久也查不出来

NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Key InceptionV3/AuxLogits/Conv2d_1b_1x1/BatchNorm/beta not found in checkpoint
[[Node: save_1/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_INT64], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]
[[Node: save_1/RestoreV2/_307 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_312_save_1/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]

准确率升不上去

您好,我在训练你给数据训练模型的时候,准确率一直都20%作用,我训练了20万次,准确率上不去。你问这是怎么回事啊?

slim里面是啥?

哈喽,大佬你好

我看到slim,不知道是干啥的,我记得tf中有slim啊,不一回事?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.