Hi,
As you know, the current supported version of Tensorflow in Colab is 2.8.0. So when I try to run the lab in Colab, it gives me the error below even though it works just fine with Tensorflow 2.1.0
Anyone knows how to fix this ?
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-4-f356b2f628c7> in <module>()
10 # configure and train the model
11 model.compile(optimizer='sgd', loss='mean_squared_error')
---> 12 model.fit(xs, ys, epochs=500,verbose=0)
13
14 # perform inference
1 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py in autograph_handler(*args, **kwargs)
1145 except Exception as e: # pylint:disable=broad-except
1146 if hasattr(e, "ag_error_metadata"):
-> 1147 raise e.ag_error_metadata.to_exception(e)
1148 else:
1149 raise
ValueError: in user code:
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1021, in train_function *
return step_function(self, iterator)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1010, in step_function **
outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1000, in run_step **
outputs = model.train_step(data)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 859, in train_step
y_pred = self(x, training=True)
File "/usr/local/lib/python3.7/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "<ipython-input-2-41acae60e8f7>", line 17, in build
dtype='float32'),
ValueError: Exception encountered when calling layer "sequential" (type Sequential).
Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
Call arguments received:
• inputs=tf.Tensor(shape=(None,), dtype=float32)
• training=True
• mask=None
this happens when calling:
model.fit(xs, ys, epochs=500,verbose=0)
C1_W3_Lab_2_custom-dense-layer.ipynb (5.6 KB)