iterating over `tf.Tensor` is not allowed in Graph execution.
error : iterating over `tf.Tensor` is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.通过iterator产生batch数据,在模型中需要使用数据的维度参数,比如data.get_shape().as_list().会报错。此时需要在iterator.next_batch()产生的实例化数据做一个尺寸定义。data.se
原创
2021-04-20 11:47:46 ·
7012 阅读 ·
2 评论