I am trying to print the shape of the tensor (running the basic transformer code) using tensor2tensor. I see "?" in the shape. I tried doing the following:
#with tf.Session() as sess:
# print(sess.run(x).shape)
But this gives me an error
cannot assign a device for operation transformer/parallel_0/transformer/Identity: {{node transformer/parallel_0/transformer/Identity}} was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device.
[[transformer/parallel_0/transformer/Identity]]
I also tried to use tf.print(tf.shape(x)) but that doesn't print anything
I am running the command :
t2t-decoder \
--data_dir=$DATA_DIR \
--problem=$PROBLEM \
--model=$MODEL \
--hparams_set=$HPARAMS \
--output_dir=$TRAIN_DIR \
--decode_hparams="beam_size=$BEAM_SIZE,alpha=$ALPHA" \
--decode_from_file=$DECODE_FILE \
--decode_to_file=translation.en
I don't know much about tensorflow, but I see that these are being used?
tf.compat.v1.train.MonitoredSession(
session_creator=tf.compat.v1.train.ChiefSessionCreator(
How Can I print shape of tensor in such a scenario? Please help!!!