Is there a way to pass dictionary in tf.data.Dataset w/ tf.py_func?
问题 I'm using tf.data.Dataset in data processing and I want to do apply some python code with tf.py_func. BTW, I found that in tf.py_func, I cannot return a dictionary. Is there any way to do it or workaround? I have code which looks like below def map_func(images, labels): """mapping python function""" # do something # cannot be expressed as a tensor graph return { 'images': images, 'labels': labels, 'new_key': new_value} def tf_py_func(images, labels): return tf.py_func(map_func, [images,