mirror of
https://github.com/clearml/clearml
synced 2025-06-23 01:55:38 +00:00
Fix auto model logging using relative path (use full absolute path)
This commit is contained in:
parent
2a2d4b6114
commit
d36f6c26da
@ -168,8 +168,9 @@ class WeightsFileHandler(object):
|
|||||||
if task is None:
|
if task is None:
|
||||||
return filepath
|
return filepath
|
||||||
|
|
||||||
|
local_model_path = os.path.abspath(filepath) if filepath else filepath
|
||||||
model_info = WeightsFileHandler.ModelInfo(
|
model_info = WeightsFileHandler.ModelInfo(
|
||||||
model=None, upload_filename=None, local_model_path=filepath,
|
model=None, upload_filename=None, local_model_path=local_model_path,
|
||||||
local_model_id=filepath, framework=framework, task=task)
|
local_model_id=filepath, framework=framework, task=task)
|
||||||
# call pre model callback functions
|
# call pre model callback functions
|
||||||
for cb in WeightsFileHandler._model_pre_callbacks.values():
|
for cb in WeightsFileHandler._model_pre_callbacks.values():
|
||||||
@ -311,8 +312,9 @@ class WeightsFileHandler(object):
|
|||||||
# WeightsFileHandler._model_out_store_lookup.pop(id(model))
|
# WeightsFileHandler._model_out_store_lookup.pop(id(model))
|
||||||
# trains_out_model, ref_model = None, None
|
# trains_out_model, ref_model = None, None
|
||||||
|
|
||||||
|
local_model_path = os.path.abspath(saved_path) if saved_path else saved_path
|
||||||
model_info = WeightsFileHandler.ModelInfo(
|
model_info = WeightsFileHandler.ModelInfo(
|
||||||
model=trains_out_model, upload_filename=None, local_model_path=saved_path,
|
model=trains_out_model, upload_filename=None, local_model_path=local_model_path,
|
||||||
local_model_id=saved_path, framework=framework, task=task)
|
local_model_id=saved_path, framework=framework, task=task)
|
||||||
|
|
||||||
if not model_info.local_model_path:
|
if not model_info.local_model_path:
|
||||||
|
@ -42,7 +42,7 @@ def get_filename_from_file_object(file_object, flush=False, analyze_file_handle=
|
|||||||
if isinstance(file_object, six.string_types):
|
if isinstance(file_object, six.string_types):
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
return os.path.abspath(file_object)
|
return os.path.abspath(file_object) if file_object else file_object
|
||||||
except Exception:
|
except Exception:
|
||||||
return file_object
|
return file_object
|
||||||
elif hasattr(file_object, 'name'):
|
elif hasattr(file_object, 'name'):
|
||||||
|
Loading…
Reference in New Issue
Block a user