Error: Symbol Zeros is already exposed as (), when importing tensorflow

I am getting this error when importing tensorflow:

import tensorflow as tf

---------------------------------------------------------------------------
SymbolAlreadyExposedError                 Traceback (most recent call last)
Cell In[2], line 1
----> 1 import tensorflow as tf

File C:\Programs\anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow\__init__.py:473
    471 if hasattr(_current_module, "keras"):
    472   try:
--> 473     keras._load()
    474   except ImportError:
    475     pass

File C:\Programs\anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow\python\util\lazy_loader.py:41, in LazyLoader._load(self)
     39 """Load the module and insert it into the parent's globals."""
     40 # Import the target module and insert it into the parent's namespace
---> 41 module = importlib.import_module(self.__name__)
     42 self._parent_module_globals[self._local_name] = module
     44 # Emit a warning if one was specified

.....
.....
.....

File C:\Programs\anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow\python\util\tf_export.py:351, in api_export.set_attr(self, func, api_names_attr, names)
    349 if api_names_attr in func.__dict__:
    350   if not self._allow_multiple_exports:
--> 351     raise SymbolAlreadyExposedError(
    352         'Symbol %s is already exposed as %s.' %
    353         (func.__name__, getattr(func, api_names_attr)))  # pylint: disable=protected-access
    354 setattr(func, api_names_attr, names)

SymbolAlreadyExposedError: Symbol Zeros is already exposed as ().

I have installed everything via anaconda3 prompt on Win 10 x64 and I have updated python and tensorflow, however the issue persists.

Python version: 3.10.13 Tensorflow version: 2.10.0 pip version: 23.2.1

1 Like