Seach in google: “tensorflow:Error encountered when serializing”
1. https://www.codetd.com/article/2304143
不加上这句的话,运行时会报如下警告。不过,运行结果都没啥问题…
WARNING:tensorflow:Error encountered when serializing global_step. Type is unsupported, or the types of the items don't match field type in CollectionDef. 'Tensor' object has no attribute 'to_proto'
2. https://www.itread01.com/content/1545194888.html
PS:执行过程中可能会有warning:
‘list’ object has no attribute ‘name’
WARNING:tensorflow:Error encountered when serializing lstm_output_embeddings.
Type is unsupported, or the types of the items don’t match field type in CollectionDef.
应该不用担心,还是能够继续执行的,后面也不受影响
3. https://github.com/tflearn/tflearn/issues/190#issuecomment-231545279
This warning shouldn’t impact your training, this is just linked with variable serialization when saving the model, I will check what is wrong there.
In general, LSTM performs better than simpleRNN as they can ‘remember’ information longer, that can explain the difference in accuracy you noticed.
4 .http://www.linzehui.me/2018/08/12/%E7%A2%8E%E7%89%87%E7%9F%A5%E8%AF%86/%E5%A6%82%E4%BD%95%E5%B0%86ELMo%E8%AF%8D%E5%90%91%E9%87%8F%E7%94%A8%E4%BA%8E%E4%B8%AD%E6%96%87/
PS:运行过程中可能会有warning:
‘list’ object has no attribute ‘name’
WARNING:tensorflow:Error encountered when serializing lstm_output_embeddings.
Type is unsupported, or the types of the items don’t match field type in CollectionDef.
应该不用担心,还是能够继续运行的,后面也不受影响。
5. https://github.com/tensorflow/tensorflow/issues/9939
WARNING:tensorflow:Error encountered when serializing LAYER_NAME_UIDS.
Type is unsupported, or the types of the items don't match field type in CollectionDef.
'dict' object has no attribute 'name'
However, a metagraphdef does export and I am able to successfully use it to recreate the trained model. After playing around with simpler architectures, it looks like the problem comes from the average pooling I do at the end, which involves a call to tf.contrib.layers.avg_pool2d
. For a trivial example that elicits this warning, please see the script at
https://gist.github.com/nryant/1f69cda71fd6a468fa5641855199f843