Open borundev opened 5 years ago
Hi, how about post the whole google colab or download it as ipython notebook and upload it here?
Hi, how about post the whole google colab or download it as ipython notebook and upload it here?
actually the notebook is first uploaded here and then accessed via google colab...
@imneonizer Sorry, I thought borundev was talking about course 4 and edit it on his or her own.
I observed that if I added these 3 lines:
BATCH_SIZE = 64 train_data = train_data.padded_batch(BATCH_SIZE, train_data.output_shapes) test_data = test_data.padded_batch(BATCH_SIZE, test_data.output_shapes)
It solves the issue and also it gave me about 87% validation accuracy after training 10 epochs, which is different from the learning curve showing in the lecture vedio.
Any clues why this is happening?
I am also seeing this issue.
I observed that if I added these 3 lines:
BATCH_SIZE = 64 train_data = train_data.padded_batch(BATCH_SIZE, train_data.output_shapes) test_data = test_data.padded_batch(BATCH_SIZE, test_data.output_shapes)
It solves the issue and also it gave me about 87% validation accuracy after training 10 epochs, which is different from the learning curve showing in the lecture vedio.
Any clues why this is happening?
Same problem here. I added these 3 lines, too. And after training 10 epochs, I get the following results:
During the model fitting I get the error ValueError: Shapes () and (None, 1) must have the same rank and during handling of it get more errors and I am reproducing the stacktrace below. However, if I peek into the next lesson and do the following
BATCH_SIZE = 64 train_data = train_data.padded_batch(BATCH_SIZE, train_data.output_shapes) test_data = test_data.padded_batch(BATCH_SIZE, test_data.output_shapes)
before the fit then it works. I understand the issue is with the inputs not having the same shape but do not understand why this is not a problem in the course video and what the best fix is.
Epoch 1/10 1/Unknown - 0s 61ms/step
ValueError Traceback (most recent call last) ~/miniconda3/envs/tf2/lib/python3.7/site-packages/tensorflow_core/python/framework/tensor_shape.py in merge_with(self, other) 927 try: --> 928 self.assert_same_rank(other) 929 new_dims = []
~/miniconda3/envs/tf2/lib/python3.7/site-packages/tensorflow_core/python/framework/tensor_shape.py in assert_same_rank(self, other) 982 raise ValueError("Shapes %s and %s must have the same rank" % --> 983 (self, other)) 984
ValueError: Shapes () and (None, 1) must have the same rank
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last) ~/miniconda3/envs/tf2/lib/python3.7/site-packages/tensorflow_core/python/ops/nn_impl.py in sigmoid_cross_entropy_with_logits(_sentinel, labels, logits, name) 167 try: --> 168 labels.get_shape().merge_with(logits.get_shape()) 169 except ValueError:
~/miniconda3/envs/tf2/lib/python3.7/site-packages/tensorflow_core/python/framework/tensor_shape.py in merge_with(self, other) 933 except ValueError: --> 934 raise ValueError("Shapes %s and %s are not compatible" % (self, other)) 935
ValueError: Shapes () and (None, 1) are not compatible
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)