TensorFlow 2.0 dataset.__iter__() is only supported when eager execution is enabled

前端 未结 3 621
故里飘歌
故里飘歌 2021-01-18 08:10

I\'m using the following custom training code in TensorFlow 2:

def parse_function(filename, filename2):
    image = read_image(fn)
    def ret1(): return ima         


        
3条回答
  •  星月不相逢
    2021-01-18 08:39

    In case you are using Jupyter notebook after

    import tensorflow as tf
    
    tf.enable_eager_execution()
    

    You need to restart the kernel and it works

提交回复
热议问题