diff --git a/Jenkinsfile_predict b/Jenkinsfile_predict index 3fe0659..e0ef330 100644 --- a/Jenkinsfile_predict +++ b/Jenkinsfile_predict @@ -14,6 +14,7 @@ pipeline { steps { sh 'rm -r my_model' + sh 'rm -r model' copyArtifacts(fingerprintArtifacts: true, projectName: 's434695-training/train', selector: buildParameter('WHICH_BUILD')) } } diff --git a/Zadanie_08_and_09_MLflow.py b/Zadanie_08_and_09_MLflow.py index 9b58a0e..d4a8e65 100644 --- a/Zadanie_08_and_09_MLflow.py +++ b/Zadanie_08_and_09_MLflow.py @@ -12,12 +12,13 @@ import os import sys import mlflow +mlflow.set_tracking_uri("http://172.17.0.1:5000") + with mlflow.start_run(): batch_param = int(sys.argv[1]) if len(sys.argv) > 1 else 16 epoch_param = int(sys.argv[2]) if len(sys.argv) > 2 else 15 - - + mlflow.set_experiment("s434788") mlflow.log_param("batch_size", batch_param) mlflow.log_param("epochs", epoch_param) @@ -75,5 +76,6 @@ with mlflow.start_run(): print(f"accuracy: {results}") mlflow.log_metric("Accuracy", results) - - mlflow.keras.save_model(NeuralModel, "my_model", signature= mlflow.models.signature.infer_signature(x_train, y_train), input_example= x_train[0]) \ No newline at end of file + + mlflow.keras.save_model(NeuralModel, "my_model", signature= mlflow.models.signature.infer_signature(x_train, y_train), input_example= x_train[0]) + mlflow.keras.log_model(NeuralModel, "model",registered_model_name="s434788", signature= mlflow.models.signature.infer_signature(x_train, y_train), input_example= x_train[0]) \ No newline at end of file diff --git a/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/meta.yaml b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/meta.yaml new file mode 100644 index 0000000..bce564d --- /dev/null +++ b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/meta.yaml @@ -0,0 +1,15 @@ +artifact_uri: file:///C:/Users/domstr2/Desktop/Git%20Repositories/ium_434788/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/artifacts +end_time: null +entry_point_name: '' +experiment_id: '0' +lifecycle_stage: active +name: '' +run_id: 4c36c99ff9db4da7939a568673fa40bd +run_uuid: 4c36c99ff9db4da7939a568673fa40bd +source_name: '' +source_type: 4 +source_version: '' +start_time: 1621808417901 +status: 1 +tags: [] +user_id: domstr2 diff --git a/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.source.git.commit b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.source.git.commit new file mode 100644 index 0000000..58c1112 --- /dev/null +++ b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.source.git.commit @@ -0,0 +1 @@ +82c812c301d802aacff75cb7f6695a3840b784b1 \ No newline at end of file diff --git a/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.source.name b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.source.name new file mode 100644 index 0000000..5285258 --- /dev/null +++ b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.source.name @@ -0,0 +1 @@ +c:\Users\domstr2\Desktop\Git Repositories\ium_434788\Zadanie_08_and_09_MLflow.py \ No newline at end of file diff --git a/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.source.type b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.source.type new file mode 100644 index 0000000..0c2c1fe --- /dev/null +++ b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.source.type @@ -0,0 +1 @@ +LOCAL \ No newline at end of file diff --git a/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.user b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.user new file mode 100644 index 0000000..313bd69 --- /dev/null +++ b/mlruns/0/4c36c99ff9db4da7939a568673fa40bd/tags/mlflow.user @@ -0,0 +1 @@ +domstr2 \ No newline at end of file diff --git a/my_model/MLmodel b/my_model/MLmodel deleted file mode 100644 index 26fb65b..0000000 --- a/my_model/MLmodel +++ /dev/null @@ -1,19 +0,0 @@ -flavors: - keras: - data: data - keras_module: tensorflow.keras - keras_version: 2.4.0 - save_format: tf - python_function: - data: data - env: conda.yaml - loader_module: mlflow.keras - python_version: 3.8.5 -saved_input_example_info: - artifact_path: input_example.json - format: tf-serving - type: ndarray -signature: - inputs: '[{"type": "tensor", "tensor-spec": {"dtype": "float64", "shape": [-1, 14]}}]' - outputs: '[{"type": "tensor", "tensor-spec": {"dtype": "int32", "shape": [-1]}}]' -utc_time_created: '2021-05-23 17:53:55.693430' diff --git a/my_model/conda.yaml b/my_model/conda.yaml deleted file mode 100644 index 3fa4018..0000000 --- a/my_model/conda.yaml +++ /dev/null @@ -1,10 +0,0 @@ -channels: -- defaults -- conda-forge -dependencies: -- python=3.8.5 -- pip -- pip: - - mlflow - - tensorflow==2.4.1 -name: mlflow-env diff --git a/my_model/data/keras_module.txt b/my_model/data/keras_module.txt deleted file mode 100644 index 2c73dfd..0000000 --- a/my_model/data/keras_module.txt +++ /dev/null @@ -1 +0,0 @@ -tensorflow.keras \ No newline at end of file diff --git a/my_model/data/model/saved_model.pb b/my_model/data/model/saved_model.pb deleted file mode 100644 index 2318a75..0000000 Binary files a/my_model/data/model/saved_model.pb and /dev/null differ diff --git a/my_model/data/model/variables/variables.data-00000-of-00001 b/my_model/data/model/variables/variables.data-00000-of-00001 deleted file mode 100644 index 167e235..0000000 Binary files a/my_model/data/model/variables/variables.data-00000-of-00001 and /dev/null differ diff --git a/my_model/data/model/variables/variables.index b/my_model/data/model/variables/variables.index deleted file mode 100644 index 5740461..0000000 Binary files a/my_model/data/model/variables/variables.index and /dev/null differ diff --git a/my_model/data/save_format.txt b/my_model/data/save_format.txt deleted file mode 100644 index 439ab29..0000000 --- a/my_model/data/save_format.txt +++ /dev/null @@ -1 +0,0 @@ -tf \ No newline at end of file diff --git a/my_model/input_example.json b/my_model/input_example.json deleted file mode 100644 index ce5d56b..0000000 --- a/my_model/input_example.json +++ /dev/null @@ -1 +0,0 @@ -{"inputs": [-0.011282211362261343, 0.6825528426633746, -0.8779676567417312, 0.25625952402130414, 0.0325916986923591, 0.1075920895847071, -0.19667888586283722, 0.6801776123326557, -0.13679826698989028, -0.6382195990287619, -0.8663788579309919, -0.787822640922809, -0.7744150275178463, -0.0063619093376772375]} \ No newline at end of file