tf.function-> AttributeError: ‘double‘ object has no attribute ‘shape‘

跑tensorflow 时出现的bug, 不使用tf.function 没问题,一旦挂上装饰符,就报错,报错内容如下:

Traceback (most recent call last):
  File "D:\Anaconda3\envs\tensorflow2\lib\site-packages\tensorflow_core\python\eager\function.py", line 111, in _make_input_signature_hashable
    hash(elem)
TypeError: unhashable type: 'double'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda3\envs\tensorflow2\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 568, in __call__
    result = self._call(*args

你可能感兴趣的:(学习tensorflow)