Closed rettinghaus closed 1 year ago
It is looking for *.h5
files in --model-dir
. Could you give more information, like the exact command you tried to execute and an ls
of the --model-dir
?
When I do -m model
I get
OSError: SavedModel file does not exist at: model/model/model_bin_sbb_ens.h5/{saved_model.pbtxt|saved_model.pb}
With -m ./model
OSError: SavedModel file does not exist at: ./model/./model/model_bin_sbb_ens.h5/{saved_model.pbtxt|saved_model.pb}
That's because you do a glob
with the given path on init, and then join the file path with model_dir
in load_model
. This cannot work.
Interesting is why I could not reproduce this problem at first:
>>> import os.path
>>> os.path.join("/home/mike/devel/qurator-data/sbb_binarization/2022-08-16/", "/home/mike/devel/qurator-data/sbb_binarization/2022-08-16/model_bin_hybrid_trans_cnn_sbb_ens.h5")
'/home/mike/devel/qurator-data/sbb_binarization/2022-08-16/model_bin_hybrid_trans_cnn_sbb_ens.h5'
@kba 👀
So the bug only occurs if using a relative path because os.path.join
has the unexpected (but documented!) behaviour of throwing away the first component if the second one is an absolute path.
Yes, it's only working for absolute paths, not relative ones. Maybe better to use proper path objects here instead of os.path
?
Looks like this is fixed, right?
It is.
Looks like this is fixed, right?
Sorry for late response. Yes it is already fixed.
Why is it is not looking in the given
--model-dir
for the model but rather in it'smodel
subdirectory?