Hello, I was using the colab notebook in the link below and it was working fine, I also used my own data and train the same network without any problem.
Now I am trying to use it again and I am getting the error below when I start fitting the model.
“TypeError:Tensor is unhashable. Instead, use tensor.ref() as the key.”
You can see the details of the error below;
/usr/local/lib/python3.9/dist-packages/einops/einops.py in tf__reduce(tensor, pattern, reduction, **axes_lengths)
61 try:
62 hashable_axes_lengths = ag__.converted_call(ag__.ld(tuple), (ag__.converted_call(ag__.ld(sorted), (ag__.converted_call(ag__.ld(axes_lengths).items, (), None, fscope),), None, fscope),), None, fscope)
—> 63 recipe = ag__.converted_call(ag__.ld(prepare_transformation_recipe), (ag_.ld(pattern), ag__.ld(reduction)), dict(axes_lengths=ag__.ld(hashable_axes_lengths)), fscope)
64 try:
65 do_return = True
TypeError: in user code:
File "/usr/local/lib/python3.9/dist-packages/keras/engine/training.py", line 1284, in train_function *
return step_function(self, iterator)
File "/usr/local/lib/python3.9/dist-packages/keras/engine/training.py", line 1268, in step_function **
outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/usr/local/lib/python3.9/dist-packages/keras/engine/training.py", line 1249, in run_step **
outputs = model.train_step(data)
File "/usr/local/lib/python3.9/dist-packages/keras/engine/training.py", line 1050, in train_step
y_pred = self(x, training=True)
File "/usr/local/lib/python3.9/dist-packages/keras/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/tmp/__autograph_generated_file01sh7f7r.py", line 22, in tf__call
videos = ag__.converted_call(ag__.ld(einops).rearrange, (ag__.ld(images), '(b t) h w c -> b t h w c'), dict(t=ag__.ld(old_shape)['t']), fscope)
File "/tmp/__autograph_generated_filefu2t6yqk.py", line 95, in tf__rearrange
retval_ = ag__.converted_call(ag__.ld(reduce), (ag__.converted_call(ag__.ld(cast), (ag__.ld(Tensor), ag__.ld(tensor)), None, fscope), ag__.ld(pattern)), dict(reduction='rearrange', **ag__.ld(axes_lengths)), fscope)
File "/tmp/__autograph_generated_filerptbnnwp.py", line 63, in tf__reduce
recipe = ag__.converted_call(ag__.ld(_prepare_transformation_recipe), (ag__.ld(pattern), ag__.ld(reduction)), dict(axes_lengths=ag__.ld(hashable_axes_lengths)), fscope)
TypeError: Exception encountered when calling layer 'resize_video_2' (type ResizeVideo).
in user code:
File "<ipython-input-4-99a2af494be2>", line 23, in call *
videos = einops.rearrange(
File "/usr/local/lib/python3.9/dist-packages/einops/einops.py", line 483, in rearrange *
return reduce(cast(Tensor, tensor), pattern, reduction='rearrange', **axes_lengths)
File "/usr/local/lib/python3.9/dist-packages/einops/einops.py", line 411, in reduce *
recipe = _prepare_transformation_recipe(pattern, reduction, axes_lengths=hashable_axes_lengths)
TypeError: Tensor is unhashable. Instead, use tensor.ref() as the key.
Call arguments received by layer 'resize_video_2' (type ResizeVideo):
• video=tf.Tensor(shape=(None, None, None, None, 16), dtype=float32)