I ran into a similar problem. Did you manage to solve this problem? I was trying to upgrade my code from Tensorflow 1.x to 2.x.
output = tf.keras.layers.Conv2DTranspose(filters=8, kernel_size=(2, 2), padding='VALID', data_format='channels_first', activation=tf.nn.relu, kernel_initializer=tf.compat.v1.variance_scaling_initializer, kernel_regularizer=None,trainable=train)(input_tensor)
Here I get the error:
AttributeError: '_TfDeviceCaptureOp' object has no attribute 'node_def'
but changing it to 'channels_last' will make the error disappear but that does not work for my network architecture. I know my data format is "NCHW" so it does not fix my problem. My environment is Python 3.7, Tensorflow 2.0.0, Cuda 10.2, Ubuntu 20.04, RTX 2070.