tensorflow: contrib.layers.avg_pool2d raises warnings when serializing metagraph

System information

  • OS Platform and Distribution: Ubuntu 14.04 LTS
  • TensorFlow installed from: source
  • TensorFlow version: (‘v1.1.0-rc2-1015-gf2047a3’, ‘1.1.0-rc2’)
  • Bazel version: 0.4.5
  • CUDA/cuDNN version: 8.0/5.1.5
  • GPU model and memory: Maxwell Titan X (12 GiB)

Overview of problem

Since updating to the most recent version (as of yesterday) of TensorFlow, I’ve started seeing the following ominous warning when serializing a wide resnet variant that I’ve been using for acoustic modeling:

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

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 18 (10 by maintainers)

Most upvoted comments

@tfboyd

I still get this error when I tried to use tf.add_to_collection to add a dictionary/list to the collection. Is it the same issue? I tested with latest 1.2.1 build for windows.

WARNING:tensorflow:Error encountered when serializing exporter_interface. Type is unsupported, or the types of the items don’t match field type in CollectionDef. ‘xxxx’ object has no attribute ‘name’

Fix is checked in internally and should get synced today. I am attempting to make sure it is in the next 1.2 RC as a final cherry pick. I will close once it hits master.

Still present in 1.2rc1: 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' @ali01 : please reclassify, this isn’t a feature-request, but a bug: This worked fine until 1.1, then models that were working without error-messages suddenly produce the error-message above. That causes people first to assume a breaking API-change, then to look for problems in their own model definition, when finding out that model-saves cause this, and finally to start digging in tf’s code for the reason of this message, which by it self sounds like the model-save did not work.

Thanks @ebrevdo for helping us know that there’s no cause for alarm. How do you think this issue should be triaged? I agree with our friends that, ideally speaking, warnings should be as helpful as possible. So maybe contributions welcome?