I apologize if you have already solved my question.
Using:
$ sudo pip3 install --pre --extra-index-url Index of /compute/redist/jp/v46 tensorflow==2.5.0+nv21.8
I have a code where I need to use the following library to load the weights of my previously trained model:
from keras.models import load_model
This is what I try to do with my code to load the weights of a file that contains them:
model = load_model (‘/ home / steven / Documents / tape_detection / model.h5’)
Can you help me think of a solution please?
This is the error:
steven@steven-desktop:~$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import tensorflow as tf
2021-12-13 14:08:18.922956: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.10.2
print(tf.version)
2.5.0
from keras.models import load_model
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python3.6/dist-packages/keras/init.py”, line 25, in
from keras import models
File “/usr/local/lib/python3.6/dist-packages/keras/models.py”, line 20, in
from keras import metrics as metrics_module
File “/usr/local/lib/python3.6/dist-packages/keras/metrics.py”, line 27, in
from keras import activations
File “/usr/local/lib/python3.6/dist-packages/keras/activations.py”, line 20, in
from keras.layers import advanced_activations
File “/usr/local/lib/python3.6/dist-packages/keras/layers/init.py”, line 148, in
from keras.layers.normalization import LayerNormalization
ImportError: cannot import name ‘LayerNormalization’