Replies: 2 comments
-
so i think a potential fix would be to just load the weights and vocabulary. for that copy the model building and even compile as if you are going to retrain it. then call set weights |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @rkrish999, Apologies for the late response, did you try @nevakrien's solution? Or potentially did you get this solved earlier? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here is the code I used (FYI: I could save and load my own model-5 after your wonderful mask_zero fix!!)
import tensorflow as tf
import tensorflow_hub as hub
from tensorflow.keras.layers.experimental.preprocessing import TextVectorization
Delete any old folders
!rm -rf /content/skimlit_gs_model
!rm -rf /content/skimlit_tribrid_model
!wget https://storage.googleapis.com/ztm_tf_course/skimlit/skimlit_tribrid_model.zip
!mkdir skimlit_gs_model
!unzip skimlit_tribrid_model.zip -d skimlit_gs_model
Load the downloaded Google Storage model
loaded_gs_model = tf.keras.models.load_model("skimlit_gs_model/skimlit_tribrid_model/")
RESULTING ERROR:
--2021-12-06 02:07:29-- https://storage.googleapis.com/ztm_tf_course/skimlit/skimlit_tribrid_model.zip
Resolving storage.googleapis.com (storage.googleapis.com)... 172.217.193.128, 74.125.31.128, 108.177.12.128, ...
Connecting to storage.googleapis.com (storage.googleapis.com)|172.217.193.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 962561955 (918M) [application/zip]
Saving to: ‘skimlit_tribrid_model.zip’
skimlit_tribrid_mod 100%[===================>] 917.97M 243MB/s in 3.9s
2021-12-06 02:07:33 (238 MB/s) - ‘skimlit_tribrid_model.zip’ saved [962561955/962561955]
Archive: skimlit_tribrid_model.zip
creating: skimlit_gs_model/skimlit_tribrid_model/
creating: skimlit_gs_model/skimlit_tribrid_model/variables/
inflating: skimlit_gs_model/skimlit_tribrid_model/variables/variables.index
inflating: skimlit_gs_model/skimlit_tribrid_model/variables/variables.data-00000-of-00001
inflating: skimlit_gs_model/skimlit_tribrid_model/keras_metadata.pb
inflating: skimlit_gs_model/skimlit_tribrid_model/saved_model.pb
creating: skimlit_gs_model/skimlit_tribrid_model/assets/
AssertionError Traceback (most recent call last)
in ()
11
12 # Load in downloaded Google Storage model
---> 13 loaded_gs_model = tf.keras.models.load_model("skimlit_gs_model/skimlit_tribrid_model/")
1 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/training/tracking/util.py in assert_existing_objects_matched(self)
829 ("Some Python objects were not bound to checkpointed values, likely "
830 "due to changes in the Python program: %s") %
--> 831 (list(unused_python_objects),))
832 return self
833
AssertionError: Some Python objects were not bound to checkpointed values, likely due to changes in the Python program: [<tensorflow.python.ops.lookup_ops.MutableHashTable object at 0x7f7eba90e850>]
Beta Was this translation helpful? Give feedback.
All reactions