You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
v2.16.1-0-g5bc9d26649c 2.16.1
Custom code
No
OS platform and distribution
Mac OS Sonoma 14.4
Mobile device
No response
Python version
3.10
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
While running the below script
python3 models/research/object_detection/builders/model_builder_tf2_test.py
I'm getting following error:
Traceback (most recent call last):
File "/Users/smitparmar/Desktop/ML/custom-object-detection/models/research/object_detection/builders/model_builder_tf2_test.py", line 24, in
from object_detection.builders import model_builder
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/object_detection/builders/model_builder.py", line 26, in
from object_detection.builders import hyperparams_builder
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/object_detection/builders/hyperparams_builder.py", line 27, in
from object_detection.core import freezable_sync_batch_norm
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/object_detection/core/freezable_sync_batch_norm.py", line 20, in
class FreezableSyncBatchNorm(tf.keras.layers.experimental.SyncBatchNormalization
AttributeError: module 'keras._tf_keras.keras.layers' has no attribute 'experimental'
This output is from google colab and above one is from my local machine Apple MacBook Pro with M1 Pro. (Tensowflow Metal is also installed)
2024-03-21 11:07:15.432006: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-03-21 11:07:16.927430: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "/content/models/research/object_detection/builders/model_builder_tf2_test.py", line 24, in<module>
from object_detection.builders import model_builder
File "/usr/local/lib/python3.10/dist-packages/object_detection/builders/model_builder.py", line 26, in<module>
from object_detection.builders import hyperparams_builder
File "/usr/local/lib/python3.10/dist-packages/object_detection/builders/hyperparams_builder.py", line 27, in<module>
from object_detection.core import freezable_sync_batch_norm
File "/usr/local/lib/python3.10/dist-packages/object_detection/core/freezable_sync_batch_norm.py", line 20, in<module>
class FreezableSyncBatchNorm(tf.keras.layers.experimental.SyncBatchNormalization
AttributeError: module 'keras._tf_keras.keras.layers' has no attribute 'experimental'
The text was updated successfully, but these errors were encountered:
import tensorflow as tf
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.models import Model
from tensorflow.keras.applications import EfficientNetB0
Example usage of BatchNormalization
inputs = tf.keras.Input(shape=(32, 32, 3))
x = EfficientNetB0(include_top=False, input_tensor=inputs)
x = BatchNormalization()(x.output)
outputs = tf.keras.layers.Dense(10, activation='softmax')(x)
model = Model(inputs=inputs, outputs=outputs)
import tensorflow as tf
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.models import Model
from tensorflow.keras.applications import EfficientNetB0
Example usage of BatchNormalization
inputs = tf.keras.Input(shape=(32, 32, 3))
x = EfficientNetB0(include_top=False, input_tensor=inputs)
x = BatchNormalization()(x.output)
outputs = tf.keras.layers.Dense(10, activation='softmax')(x)
model = Model(inputs=inputs, outputs=outputs)
Rest of your code
Thanks for the response.
Could you please check the link mentioned above to reproduce the issue?
Hey @mark-nicepants, Thanks for your response. I'll surely try out your suggestion.
However, I was able to get some success and will share the link shortly.
Issue type
Build/Install
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
v2.16.1-0-g5bc9d26649c 2.16.1
Custom code
No
OS platform and distribution
Mac OS Sonoma 14.4
Mobile device
No response
Python version
3.10
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
While running the below script
python3 models/research/object_detection/builders/model_builder_tf2_test.py
I'm getting following error:
Traceback (most recent call last):
File "/Users/smitparmar/Desktop/ML/custom-object-detection/models/research/object_detection/builders/model_builder_tf2_test.py", line 24, in
from object_detection.builders import model_builder
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/object_detection/builders/model_builder.py", line 26, in
from object_detection.builders import hyperparams_builder
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/object_detection/builders/hyperparams_builder.py", line 27, in
from object_detection.core import freezable_sync_batch_norm
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/object_detection/core/freezable_sync_batch_norm.py", line 20, in
class FreezableSyncBatchNorm(tf.keras.layers.experimental.SyncBatchNormalization
AttributeError: module 'keras._tf_keras.keras.layers' has no attribute 'experimental'
Standalone code to reproduce the issue
https://drive.google.com/file/d/18z2bj-xRlXT2J6QvplLiYv2uoLei_1bX/view?usp=sharing
Relevant log output
The text was updated successfully, but these errors were encountered: