tensorflow模型.meta在训练中大小变不变?

哈喽,搜了下这个问题,没人遇到过。还是我心细,注重细节。细节决定关键问题的成败。

按道理说不应该变化,你看keras的h5模型训练过程中一点都没有变化。

但是你看.meta的结果

1-大小改变的,.meta从2.4M到3.2M这就是变化。难道我的模型有问题?我测试下效果如何,顺便转成pb

3.2M Oct 13 08:12 checkpoint-186000.meta
91 Oct 13 08:12 checkpoint
8.3M Oct 13 08:12 checkpoint-186000.data-00000-of-00001
1.6K Oct 13 08:12 checkpoint-186000.index
3.2M Oct 13 08:08 checkpoint-185000.meta
8.3M Oct 13 08:08 checkpoint-185000.data-00000-of-00001
1.6K Oct 13 08:08 checkpoint-185000.index
3.2M Oct 13 08:04 checkpoint-184000.meta
8.3M Oct 13 08:04 checkpoint-184000.data-00000-of-00001
1.6K Oct 13 08:04 checkpoint-184000.index
3.1M Oct 13 08:00 checkpoint-183000.meta
1.6K Oct 13 08:00 checkpoint-183000.index
8.3M Oct 13 08:00 checkpoint-183000.data-00000-of-00001
3.1M Oct 13 07:56 checkpoint-182000.meta
8.3M Oct 13 07:56 checkpoint-182000.data-00000-of-00001
1.6K Oct 13 07:56 checkpoint-182000.index
3.1M Oct 13 07:51 checkpoint-181000.meta
8.3M Oct 13 07:51 checkpoint-181000.data-00000-of-00001
1.6K Oct 13 07:51 checkpoint-181000.index
3.1M Oct 13 07:47 checkpoint-180000.meta
8.3M Oct 13 07:47 checkpoint-180000.data-00000-of-00001
1.6K Oct 13 07:47 checkpoint-180000.index
3.1M Oct 13 07:43 checkpoint-179000.meta
8.3M Oct 13 07:43 checkpoint-179000.data-00000-of-00001
1.6K Oct 13 07:43 checkpoint-179000.index
3.1M Oct 13 07:39 checkpoint-178000.meta
8.3M Oct 13 07:39 checkpoint-178000.data-00000-of-00001
1.6K Oct 13 07:39 checkpoint-178000.index
3.1M Oct 13 07:35 checkpoint-177000.meta
8.3M Oct 13 07:35 checkpoint-177000.data-00000-of-00001
1.6K Oct 13 07:35 checkpoint-177000.index
3.0M Oct 13 07:31 checkpoint-176000.meta
8.3M Oct 13 07:31 checkpoint-176000.data-00000-of-00001
1.6K Oct 13 07:31 checkpoint-176000.index
3.0M Oct 13 07:27 checkpoint-175000.meta
8.3M Oct 13 07:27 checkpoint-175000.data-00000-of-00001
1.6K Oct 13 07:27 checkpoint-175000.index
3.0M Oct 13 07:23 checkpoint-174000.meta
8.3M Oct 13 07:23 checkpoint-174000.data-00000-of-00001
1.6K Oct 13 07:23 checkpoint-174000.index
3.0M Oct 13 07:19 checkpoint-173000.meta
8.3M Oct 13 07:19 checkpoint-173000.data-00000-of-00001
1.6K Oct 13 07:19 checkpoint-173000.index
3.0M Oct 13 07:15 checkpoint-172000.meta
8.3M Oct 13 07:15 checkpoint-172000.data-00000-of-00001
1.6K Oct 13 07:15 checkpoint-172000.index
3.0M Oct 13 07:11 checkpoint-171000.meta
8.3M Oct 13 07:11 checkpoint-171000.data-00000-of-00001
1.6K Oct 13 07:11 checkpoint-171000.index
2.9M Oct 13 07:07 checkpoint-170000.meta
8.3M Oct 13 07:07 checkpoint-170000.data-00000-of-00001
1.6K Oct 13 07:07 checkpoint-170000.index
2.9M Oct 13 07:03 checkpoint-169000.meta
8.3M Oct 13 07:03 checkpoint-169000.data-00000-of-00001
1.6K Oct 13 07:03 checkpoint-169000.index
2.9M Oct 13 06:59 checkpoint-168000.meta
8.3M Oct 13 06:59 checkpoint-168000.data-00000-of-00001
1.6K Oct 13 06:59 checkpoint-168000.index
2.9M Oct 13 06:55 checkpoint-167000.meta
8.3M Oct 13 06:55 checkpoint-167000.data-00000-of-00001
1.6K Oct 13 06:55 checkpoint-167000.index
2.9M Oct 13 06:51 checkpoint-166000.meta
8.3M Oct 13 06:51 checkpoint-166000.data-00000-of-00001
1.6K Oct 13 06:51 checkpoint-166000.index
2.9M Oct 13 06:47 checkpoint-165000.meta
8.3M Oct 13 06:47 checkpoint-165000.data-00000-of-00001
1.6K Oct 13 06:47 checkpoint-165000.index
2.8M Oct 13 06:43 checkpoint-164000.meta
8.3M Oct 13 06:43 checkpoint-164000.data-00000-of-00001
1.6K Oct 13 06:43 checkpoint-164000.index
2.8M Oct 13 06:39 checkpoint-163000.meta
1.6K Oct 13 06:39 checkpoint-163000.index
8.3M Oct 13 06:39 checkpoint-163000.data-00000-of-00001
2.8M Oct 13 06:35 checkpoint-162000.meta
8.3M Oct 13 06:35 checkpoint-162000.data-00000-of-00001
1.6K Oct 13 06:35 checkpoint-162000.index
2.8M Oct 13 06:31 checkpoint-161000.meta
8.3M Oct 13 06:31 checkpoint-161000.data-00000-of-00001
1.6K Oct 13 06:31 checkpoint-161000.index
2.8M Oct 13 06:27 checkpoint-160000.meta
8.3M Oct 13 06:27 checkpoint-160000.data-00000-of-00001
1.6K Oct 13 06:27 checkpoint-160000.index
2.8M Oct 13 06:23 checkpoint-159000.meta
8.3M Oct 13 06:23 checkpoint-159000.data-00000-of-00001
1.6K Oct 13 06:23 checkpoint-159000.index
2.8M Oct 13 06:18 checkpoint-158000.meta
8.3M Oct 13 06:18 checkpoint-158000.data-00000-of-00001
1.6K Oct 13 06:18 checkpoint-158000.index
2.7M Oct 13 06:14 checkpoint-157000.meta
8.3M Oct 13 06:14 checkpoint-157000.data-00000-of-00001
1.6K Oct 13 06:14 checkpoint-157000.index
2.7M Oct 13 06:10 checkpoint-156000.meta
8.3M Oct 13 06:10 checkpoint-156000.data-00000-of-00001
1.6K Oct 13 06:10 checkpoint-156000.index
2.7M Oct 13 06:07 checkpoint-155000.meta
8.3M Oct 13 06:07 checkpoint-155000.data-00000-of-00001
1.6K Oct 13 06:07 checkpoint-155000.index
2.7M Oct 13 06:03 checkpoint-154000.meta
8.3M Oct 13 06:03 checkpoint-154000.data-00000-of-00001
1.6K Oct 13 06:03 checkpoint-154000.index
2.7M Oct 13 05:59 checkpoint-153000.meta
8.3M Oct 13 05:59 checkpoint-153000.data-00000-of-00001
1.6K Oct 13 05:59 checkpoint-153000.index
2.7M Oct 13 05:55 checkpoint-152000.meta
8.3M Oct 13 05:55 checkpoint-152000.data-00000-of-00001
1.6K Oct 13 05:55 checkpoint-152000.index
2.6M Oct 13 05:51 checkpoint-151000.meta
8.3M Oct 13 05:51 checkpoint-151000.data-00000-of-00001
1.6K Oct 13 05:51 checkpoint-151000.index
2.6M Oct 13 05:47 checkpoint-150000.meta
8.3M Oct 13 05:47 checkpoint-150000.data-00000-of-00001
1.6K Oct 13 05:47 checkpoint-150000.index
2.6M Oct 13 05:43 checkpoint-149000.meta
8.3M Oct 13 05:43 checkpoint-149000.data-00000-of-00001
1.6K Oct 13 05:43 checkpoint-149000.index
2.6M Oct 13 05:39 checkpoint-148000.meta
8.3M Oct 13 05:39 checkpoint-148000.data-00000-of-00001
1.6K Oct 13 05:39 checkpoint-148000.index
2.6M Oct 13 05:35 checkpoint-147000.meta
8.3M Oct 13 05:35 checkpoint-147000.data-00000-of-00001
1.6K Oct 13 05:35 checkpoint-147000.index
2.6M Oct 13 05:31 checkpoint-146000.meta
1.6K Oct 13 05:31 checkpoint-146000.index
8.3M Oct 13 05:31 checkpoint-146000.data-00000-of-00001
2.6M Oct 13 05:27 checkpoint-145000.meta
8.3M Oct 13 05:27 checkpoint-145000.data-00000-of-00001
1.6K Oct 13 05:27 checkpoint-145000.index
2.5M Oct 13 05:23 checkpoint-144000.meta
8.3M Oct 13 05:23 checkpoint-144000.data-00000-of-00001
1.6K Oct 13 05:23 checkpoint-144000.index
2.5M Oct 13 05:18 checkpoint-143000.meta
8.3M Oct 13 05:18 checkpoint-143000.data-00000-of-00001
1.6K Oct 13 05:18 checkpoint-143000.index
2.5M Oct 13 05:15 checkpoint-142000.meta
8.3M Oct 13 05:14 checkpoint-142000.data-00000-of-00001
1.6K Oct 13 05:14 checkpoint-142000.index
2.5M Oct 13 05:10 checkpoint-141000.meta
8.3M Oct 13 05:10 checkpoint-141000.data-00000-of-00001
1.6K Oct 13 05:10 checkpoint-141000.index
2.5M Oct 13 05:06 checkpoint-140000.meta
8.3M Oct 13 05:06 checkpoint-140000.data-00000-of-00001
1.6K Oct 13 05:06 checkpoint-140000.index
2.5M Oct 13 05:02 checkpoint-139000.meta
8.3M Oct 13 05:02 checkpoint-139000.data-00000-of-00001
1.6K Oct 13 05:02 checkpoint-139000.index
2.4M Oct 13 04:58 checkpoint-138000.meta
8.3M Oct 13 04:58 checkpoint-138000.data-00000-of-00001
1.6K Oct 13 04:58 checkpoint-138000.index
2.4M Oct 13 04:54 checkpoint-137000.meta
8.3M Oct 13 04:54 checkpoint-137000.data-00000-of-00001
1.6K Oct 13 04:54 checkpoint-137000.index
2.4M Oct 13 04:51 checkpoint-136000.meta
8.3M Oct 13 04:51 checkpoint-136000.data-00000-of-00001
1.6K Oct 13 04:51 checkpoint-136000.index
2.4M Oct 13 04:47 checkpoint-135000.meta
8.3M Oct 13 04:47 checkpoint-135000.data-00000-of-00001
1.6K Oct 13 04:47 checkpoint-135000.index
2.4M Oct 13 04:43 checkpoint-134000.meta
8.3M Oct 13 04:43 checkpoint-134000.data-00000-of-00001
1.6K Oct 13 04:43 checkpoint-134000.index
2.4M Oct 13 04:39 checkpoint-133000.meta
8.3M Oct 13 04:39 checkpoint-133000.data-00000-of-00001
1.6K Oct 13 04:39 checkpoint-133000.index

测试的pb效果不错,不过有个前提,那就是输入(None,5,513)不是一个batch,而是整个处理的,所以这种不实用,实时无法实现,下面转下tflite,可想而知有Ops不支持,只能借用tf的。转tflite方法参见我的这个博文。

按照这个转过去后发现不能用,因为有个Op不支持!!!!卧槽!!!!

  File "D:\python\lib\site-packages\tensorflow\lite\python\interpreter.py", line 77, in __init__
    model_path))
ValueError: Didn't find custom op for name 'TensorListFromTensor' with version 1
Registration failed.

下面试试tf.compat.v1.lite中的dynamic,也是同样原因不支持。卧槽,之前能够用tf成功的,这次怎么不行了。

以后要做好记录。应该是去掉控制流那句代码,训练时,转pb时都不要。

经过测试,meta文件大小改变的,也就是随训练过程逐渐增大的结果也是正确的,只要模型构建正确即可。

2-meta文件大小不变的,说实话这个训练的过程我还是从nohup.out中抠出来的,先复制粘贴到excel中,然后寻找关键字loss。

因为训练在进行中,还没结束,所以程序中的画图还未执行,我抠出来的结果如下:

tensorflow模型.meta在训练中大小变不变?_第1张图片

说明是有效地,meta不变化也可能是正确的。

 

 

另外有相关问题可以加入QQ群讨论,不设微信群

QQ群:868373192 

语音深度学习群

你可能感兴趣的:(python)