'AssertionError: Duplicate registrations for type 'experimentalOptimizer'
I'm trying to create tensorflow records for training a model with tensorflow, but I'm facing an AssertionError : ( I've already faced this error when i tried to verify some installation but it got fixed when i reisntalled tensorflow but it occures again and nothing works with it)
Traceback (most recent call last):
File "D:\Program\test2\Tensorflow\scripts\generate_tfrecord.py", line 27, in <module>
import tensorflow.compat.v1 as tf
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\__init__.py", line 474, in <module>
keras._load()
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 41, in _load
module = importlib.import_module(self.__name__)
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\__init__.py", line 25, in <module>
from keras import models
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\models\__init__.py", line 18, in <module>
from keras.engine.functional import Functional
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\engine\functional.py", line 25, in <module>
from keras.engine import base_layer
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\engine\base_layer.py", line 43, in <module>
from keras.mixed_precision import loss_scale_optimizer
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\mixed_precision\loss_scale_optimizer.py", line 20, in <module>
from keras.optimizer_experimental import optimizer as optimizer_experimental
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\optimizer_experimental\optimizer.py", line 649, in <module>
tf.__internal__.saved_model.load.register_revived_type(
File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\saved_model\revived_types.py", line 133, in register_revived_type
raise AssertionError(f"Duplicate registrations for type '{identifier}'")
AssertionError: Duplicate registrations for type 'experimentalOptimizer'
What should I do to fix it?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
