I just ran this notebook on google colab verbatim without change, and placing all the required files.
At train.fit(…), i got:
AttributeError: 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/transformers/modeling_tf_utils.py", line 947, in compute_loss *
return super().compute_loss(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 919, in compute_loss **
y, y_pred, sample_weight, regularization_losses=self.losses)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/compile_utils.py", line 199, in __call__
y_t, y_p, sw = match_dtype_and_rank(y_t, y_p, sw)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/compile_utils.py", line 686, in match_dtype_and_rank
if ((y_t.dtype.is_floating and y_p.dtype.is_floating) or
AttributeError: 'NoneType' object has no attribute 'dtype'
Thats rather unfortunate. All the assignments are locked after you get the certificate, so i can’t go check. But if someone still has an active subscription, please execute this cell and let us know the hugging face version
Thanks a lot. I tried that and still errored. Next thing may be tensorflow version. I will lower the version and see if i can make it work. If you do also know this, please let me know.
it seems the problem may lie more with the tensorflow version.
Update: There’s a method name conflict with huggingface model method compute_loss and keras TF 2.8 where it introduces compute_loss() as a new method. The way to call this in TF 2.8 is