Closed hmaarrfk closed 7 months ago
For what its worth, the same thing happens on tensorflow 2.15 installed from pip
mamba create --name tf python=3.11
mamba activate tf
pip install tensorflow tf_keras
python -c "from tensorflow.python.layers import normalization as normalization_layers; normalization_layers.BatchNormalization"
2023-11-28 08:08:47.469714: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2023-11-28 08:08:47.512597: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2023-11-28 08:08:47.512642: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2023-11-28 08:08:47.513608: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-11-28 08:08:47.519596: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2023-11-28 08:08:47.519785: I tensorflow/core/platform/cpu_feature_guard.cc:182] 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.
2023-11-28 08:08:48.298875: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/mark/miniforge3/envs/tf/lib/python3.11/site-packages/tensorflow/python/layers/normalization.py", line 30, in __getattr__
return normalization.BatchNormalization
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mark/miniforge3/envs/tf/lib/python3.11/site-packages/tensorflow/python/util/lazy_loader.py", line 67, in __getattr__
module = self._load()
^^^^^^^^^^^^
File "/home/mark/miniforge3/envs/tf/lib/python3.11/site-packages/tensorflow/python/util/lazy_loader.py", line 50, in _load
module = importlib.import_module(self.__name__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mark/miniforge3/envs/tf/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tf_keras.legacy_tf_layers'
I believe its just an internal API layer that is still an appendage.
tf-slim should release a new update to incorporate the fixes they have already done: https://github.com/google-research/tf-slim/issues/24
they have ignored my patch for more than 1 year https://github.com/google-research/tf-slim/pull/21
so i'm going to see what other maintainers think of https://github.com/conda-forge/tf-slim-feedstock/pull/6
Solution to issue cannot be found in the documentation.
Issue
Installed packages
Environment info