Skip to content

TypeError: unhashable type: 'list'. When running "model_builder_tf2_test.py" #11161

Open
@RodasPneus

Description

@RodasPneus

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [ x] I am using the latest TensorFlow Model Garden release and TensorFlow 2.
  • [ x] I am reporting the issue to the correct repository. (Model Garden official or research directory)
  • [x ] I checked to make sure that this issue has not been filed already.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/research/object_detection/builders/model_builder_tf2_test.py

2. Describe the bug

Whenever I run the file I get the following error:

2024-02-13 17:26:05.504018: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
Traceback (most recent call last):
  File "C:\programacao\CNN-JUPYTER\TFODCourse\Tensorflow\models\research\object_detection\builders\model_builder_tf2_test.py", line 21, in <module>
    import tensorflow.compat.v1 as tf
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\__init__.py", line 45, in <module>
    from tensorflow._api.v2 import __internal__
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\_api\v2\__internal__\__init__.py", line 8, in <module>
    from tensorflow._api.v2.__internal__ import autograph
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\_api\v2\__internal__\autograph\__init__.py", line 8, in <module>
    from tensorflow.python.autograph.core.ag_ctx import control_status_ctx # line: 34
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\autograph\core\ag_ctx.py", line 21, in <module>
    from tensorflow.python.autograph.utils import ag_logging
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\autograph\utils\__init__.py", line 17, in <module>
    from tensorflow.python.autograph.utils.context_managers import control_dependency_on_returns
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\autograph\utils\context_managers.py", line 19, in <module>
    from tensorflow.python.framework import ops
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\framework\ops.py", line 5906, in <module>
    ) -> Optional[Callable[[Any], message.Message]]:
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\typing.py", line 262, in inner
    return func(*args, **kwds)
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\typing.py", line 339, in __getitem__
    return self._getitem(self, parameters)
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\typing.py", line 463, in Optional
    return Union[arg, type(None)]
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\typing.py", line 262, in inner
    return func(*args, **kwds)
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\typing.py", line 339, in __getitem__
    return self._getitem(self, parameters)
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\typing.py", line 451, in Union
    parameters = _remove_dups_flatten(parameters)
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\typing.py", line 231, in _remove_dups_flatten
    return tuple(_deduplicate(params))
  File "C:\Users\rodri\AppData\Local\Programs\Python\Python39\lib\typing.py", line 205, in _deduplicate
    all_params = set(params)
TypeError: unhashable type: 'list'

3. Steps to reproduce

Clone the repo and run the file

4. Expected behavior

The file should run the tests without any errors

5. Additional context

This has been happening for a while with the file: https://github.com/tensorflow/models/blob/master/research/object_detection/model_main_tf2.py
I reinstalled everything and ran the file in a virtual environment to see if it fixed itself and it didn't. This error happens with both the est file and the normal file.

6. System information

  • Windows 10 22H2 19045.3930
  • Mobile device name if the issue happens on a mobile device:
  • TensorFlow installed from binary
  • TensorFlow version (use command below): 2.15.0
  • Python version: 3.9.1
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version: Not using
  • GPU model and memory: Not using

Metadata

Metadata

Assignees

Labels

models:researchmodels that come under research directorytype:bugBug in the code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions