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
I have model_a and model_b, is there any elegant way to remove model_a from gpu memory after i copy weights from model_a to model_b. Except for save and reload from disk
The text was updated successfully, but these errors were encountered:
HI @xfchen0912 , in TensorFlow 2 memory is freed eagerly when there are no more references to the model in Python. So you can do something like:
model_a= ...
model_b= ...
copy_weights(model_a, model_b)
delmodel_a# If there are no other references to model_a GPU memory associated with it will be released.
I have model_a and model_b, is there any elegant way to remove model_a from gpu memory after i copy weights from model_a to model_b. Except for save and reload from disk
The text was updated successfully, but these errors were encountered: