old version of model.predict stored

This commit is contained in:
Sefik Ilkin Serengil 2023-10-22 19:46:02 +01:00
parent 68eaafc614
commit 8eb8d96a54

View File

@ -695,7 +695,8 @@ def represent(
# represent # represent
if "keras" in str(type(model)): if "keras" in str(type(model)):
# new tf versions show progress bar and it is annoying # model.predict causes memory issue when it is called in a for loop
# embedding = model.predict(img, verbose=0)[0].tolist()
embedding = model(img, training=False).numpy()[0].tolist() embedding = model(img, training=False).numpy()[0].tolist()
else: else:
# SFace and Dlib are not keras models and no verbose arguments # SFace and Dlib are not keras models and no verbose arguments