I'm getting the following error when trying to import bert_models repository

Seems like register_keras_serializable is not an attribute in the tf.keras.utils libary...?
Hi, are you using tf-nightly? If you are using tf 2.0 release, the symbol is not added. Overall, it is not really useful. You can delete them.
If you just want to use TF2.0 ver, please use this branch https://github.com/tensorflow/models/tree/tf_2_0_rc1
I am getting below error while trying
from rasa.jupyter import chat
chat(model_path)
AttributeError Traceback (most recent call last)
1 from rasa.jupyter import chat
----> 2 chat(model_path)
D:SoftwareMachine_Learningrasajupyter.py in chat(model_path, agent, interpreter)
31 from rasa.run import create_agent
32
---> 33 agent = create_agent(model_path)
34
35 elif agent is not None and interpreter is not None:
D:SoftwareMachine_Learningrasarun.py in create_agent(model, endpoints)
75 tracker_store=_tracker_store,
76 lock_store=_lock_store,
---> 77 action_endpoint=_endpoints.action,
78 )
D:SoftwareMachine_Learningrasacoreagent.py in load(cls, model_path, interpreter, generator, tracker_store, lock_store, action_endpoint, model_server, remote_storage, path_to_model_archive)
420
421 if not interpreter and nlu_model:
--> 422 interpreter = NaturalLanguageInterpreter.create(nlu_model)
423
424 domain = None
D:SoftwareMachine_Learningrasacoreinterpreter.py in create(obj, endpoint)
52 return obj
53 elif isinstance(obj, str) and os.path.exists(obj):
---> 54 return RasaNLUInterpreter(model_directory=obj)
55 elif isinstance(obj, str) and not os.path.exists(obj):
56 # user passed in a string, but file does not exist
D:SoftwareMachine_Learningrasacoreinterpreter.py in __init__(self, model_directory, config_file, lazy_init)
272
273 if not lazy_init:
--> 274 self._load_interpreter()
275 else:
276 self.interpreter = None
D:SoftwareMachine_Learningrasacoreinterpreter.py in _load_interpreter(self)
295 from rasa.nlu.model import Interpreter
296
--> 297 self.interpreter = Interpreter.load(self.model_directory)
298
299
D:SoftwareMachine_Learningrasanlumodel.py in load(model_dir, component_builder, skip_validation)
299
300 Interpreter.ensure_model_compatibility(model_metadata)
--> 301 return Interpreter.create(model_metadata, component_builder, skip_validation)
302
303 @staticmethod
D:SoftwareMachine_Learningrasanlumodel.py in create(model_metadata, component_builder, skip_validation)
321 # lets check if all required packages are available
322 if not skip_validation:
--> 323 components.validate_requirements(model_metadata.component_classes)
324
325 for i in range(model_metadata.number_of_components):
D:SoftwareMachine_Learningrasanlucomponents.py in validate_requirements(component_names)
44 """
45
---> 46 from rasa.nlu import registry
47
48 # Validate that all required packages are installed
D:SoftwareMachine_Learningrasanluregistry.py in
11 from rasa.constants import DOCS_URL_COMPONENTS
12
---> 13 from rasa.nlu.classifiers.diet_classifier import DIETClassifier
14 from rasa.nlu.classifiers.keyword_intent_classifier import KeywordIntentClassifier
15 from rasa.nlu.classifiers.mitie_intent_classifier import MitieIntentClassifier
D:SoftwareMachine_Learningrasanluclassifiersdiet_classifier.py in
7 import scipy.sparse
8 import tensorflow as tf
----> 9 import tensorflow_addons as tfa
10
11 from typing import Any, Dict, List, Optional, Text, Tuple, Union, Type, NamedTuple
D:SoftwareMachine_Learningtensorflow_addons__init__.py in
19
20 # Local project imports
---> 21 from tensorflow_addons import activations
22 from tensorflow_addons import callbacks
23 from tensorflow_addons import image
D:SoftwareMachine_Learningtensorflow_addonsactivations__init__.py in
19 from __future__ import print_function
20
---> 21 from tensorflow_addons.activations.gelu import gelu
22 from tensorflow_addons.activations.hardshrink import hardshrink
23 from tensorflow_addons.activations.lisht import lisht
D:SoftwareMachine_Learningtensorflow_addonsactivationsgelu.py in
25
26
---> 27 @tf.keras.utils.register_keras_serializable(package='Addons')
28 def gelu(x, approximate=True):
29 """Gaussian Error Linear Unit.
AttributeError: module 'tensorflow.python.keras.api._v2.keras.utils' has no attribute 'register_keras_serializable'
Same error?
Hi, so I just struggled with this problem for a few days. Here is how I solved it: it turns out I was using the wrong python folder. I was dealing with conda environments and had everything installed on my conda environment but was using the default path to my local installation of python as a kernel. I fixed this by changing what kernel I was using with my jupyter notebook to be my conda environment.
While you may not have the exact same issue, I can almost 100% guarantee that it has to do with your environment and installation of tensorflow. Make sure that the directory referenced in the error, (the path to gelu.py) is the same directory that you are installing tensorflow in.
Hi, so I just struggled with this problem for a few days. Here is how I solved it: it turns out I was using the wrong python folder. I was dealing with conda environments and had everything installed on my conda environment but was using the default path to my local installation of python as a kernel. I fixed this by changing what kernel I was using with my jupyter notebook to be my conda environment.
While you may not have the exact same issue, I can almost 100% guarantee that it has to do with your environment and installation of tensorflow. Make sure that the directory referenced in the error, (the path to gelu.py) is the same directory that you are installing tensorflow in.
@pmj714 which version of tensorflow and python you are using?
I tried installing tensorflow 2.2.0. but it doesn't work for me. So, I re-installed tensorflow 2.0.0.
I am getting the following error.
(tensorflow) C:tensorflowmodelsresearchobject_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
Traceback (most recent call last): File "train.py", line 54, in from object_detection.builders import model_builder File "C:UsersJayanthanaconda3envstensorflowlibsite-packagesobject_detection-0.1-py3.6.eggobject_detectionbuildersmodel_builder.py", line 66, in from object_detection.models import ssd_efficientnet_bifpn_feature_extractor as ssd_efficientnet_bifpn File "C:UsersJayanthanaconda3envstensorflowlibsite-packagesobject_detection-0.1-py3.6.eggobject_detectionmodelsssd_efficientnet_bifpn_feature_extractor.py", line 33, in from official.vision.image_classification.efficientnet import efficientnet_model File "C:UsersJayanthanaconda3envstensorflowlibsite-packagesofficialvisionimage_classificationefficientnetefficientnet_model.py", line 35, in from official.modeling import tf_utils File "C:UsersJayanthanaconda3envstensorflowlibsite-packagesofficialmodelingtf_utils.py", line 25, in from official.modeling import activations File "C:UsersJayanthanaconda3envstensorflowlibsite-packagesofficialmodelingactivations_init_.py", line 16, in from official.modeling.activations.gelu import gelu File "C:UsersJayanthanaconda3envstensorflowlibsite-packagesofficialmodelingactivationsgelu.py", line 26, in @tf.keras.utils.register_keras_serializable(package='Text') AttributeError: module 'tensorflow_core.keras.utils' has no attribute 'register_keras_serializable'
Most helpful comment
Same error?