Zaktualizuj 'ml_pytorch_mlflow.py'

This commit is contained in:
Sebastian Wałęsa 2022-05-15 22:00:38 +02:00
parent baeefdbc79
commit acc735d7ba

View File

@ -146,11 +146,13 @@ def my_main(epochs):
for i in range(0, len(val_ds), 1): for i in range(0, len(val_ds), 1):
input_, target = val_ds[i] input_, target = val_ds[i]
file.write(str(predict_single(input_, target, model))) file.write(str(predict_single(input_, target, model)))
input_example = val_ds[0] print(input_)
# input_example = input_example.unsqueeze(0)
signature = infer_signature(input_[0], prediction(input_[0], model)) # input_example = val_ds[0]
tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme # # input_example = input_example.unsqueeze(0)
# signature = infer_signature(input_[0], prediction(input_[0], model))
# tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
if tracking_url_type_store != "file": if tracking_url_type_store != "file":
mlflow.pytorch.log_model(model, "model", registered_model_name="s478839", signature=siganture, mlflow.pytorch.log_model(model, "model", registered_model_name="s478839", signature=siganture,