Tensorflow 2 implementation of complete pipeline for multiclass image semantic segmentation using UNet, SegNet and FCN32 architectures on Cambridge-driving Labeled Video Database (CamVid) dataset.
82
stars
41
forks
source link
TypeError: An op outside of the function building code is being passed a "Graph" tensor #8
output:
TypeError: An op outside of the function building code is being passed
a "Graph" tensor. It is possible to have Graph tensors
leak out of the function building context by including a
tf.init_scope in your function building code.
For example, the following function will fail:
@tf.function
def has_init_scope():
my_constant = tf.constant(1.)
with tf.init_scope():
added = my_constant * 2
The graph tensor has name: Shape_1:0
I changed this model to 3 classes, filters=3, batch=1 and I have trained on 3 classes and I have got an error.
Train model
batch_size = 1 result = model.fit_generator(TrainAugmentGenerator(), steps_per_epoch=18 , validation_data = ValAugmentGenerator(), validation_steps = validation_steps, epochs=num_epochs, callbacks=callbacks) model.save_weights("camvid_model_150_epochs.h5", overwrite=True)
output: TypeError: An op outside of the function building code is being passed a "Graph" tensor. It is possible to have Graph tensors leak out of the function building context by including a tf.init_scope in your function building code. For example, the following function will fail: @tf.function def has_init_scope(): my_constant = tf.constant(1.) with tf.init_scope(): added = my_constant * 2 The graph tensor has name: Shape_1:0