Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] <KFP v2 Metrics Doesn't show up> #8675

Closed
kimkihoon0515 opened this issue Jan 14, 2023 · 3 comments
Closed

[bug] <KFP v2 Metrics Doesn't show up> #8675

kimkihoon0515 opened this issue Jan 14, 2023 · 3 comments
Labels

Comments

@kimkihoon0515
Copy link

Environment

  • How do you deploy Kubeflow Pipelines (KFP)?
    I deployed Kubeflow using this command
minikube start --driver=docker --kubernetes-version=1.23.14 --memory=12g --cpus=4
  • KFP version:
    1.8.18

Steps to reproduce

I'm trying to get confusion matrix metric output by using kfp v2 like this

@component(
    packages_to_install=['scikit-learn'],
    base_image='python:3.9'
)
def iris_sgdclassifier(test_samples_fraction: float, metrics: Output[ClassificationMetrics]):
    from sklearn import datasets, model_selection
    from sklearn.linear_model import SGDClassifier
    from sklearn.metrics import confusion_matrix

    iris_dataset = datasets.load_iris()
    train_x, test_x, train_y, test_y = model_selection.train_test_split(
        iris_dataset['data'], iris_dataset['target'], test_size=test_samples_fraction)


    classifier = SGDClassifier()
    classifier.fit(train_x, train_y)
    predictions = model_selection.cross_val_predict(classifier, train_x, train_y, cv=3)
    metrics.log_confusion_matrix(
        ['Setosa', 'Versicolour', 'Virginica'],
        confusion_matrix(train_y, predictions).tolist() # .tolist() to convert np array to list.
    )

and it shows me a confusion matrix output in "Visualizations" tab.
image

But nothing shows up in "Input/Output" tab.
image

Expected result

Actually I'm trying to compare confusion matrixes of several runs which is possible on kfp v2.
image

the log says

launcher.go:560] Local filepath "/minio/mlpipeline/v2/artifacts/pipeline/v2-metrics/58c160ea-4ef3-49c8-a08a-0e1c0347a031/iris-sgdclassifier/metrics" does not exist

I think that log comes out because theres no output file in the component. But idk how to do it.

Materials and reference

https://www.kubeflow.org/docs/components/pipelines/v1/sdk-v2/run-comparison/


Impacted by this bug? Give it a 👍.

@kimkihoon0515 kimkihoon0515 changed the title [bug] <KFP v2 Metrics Doenst show up> [bug] <KFP v2 Metrics Doesn't show up> Jan 14, 2023
@zijianjoy
Copy link
Collaborator

Hello @kimkihoon0515 , can you deploy Kubeflow Pipelines 2.0.0-alpha versions like this one? https://github.com/kubeflow/pipelines/releases/tag/2.0.0-alpha.6.

Also, please use KFP SDK version which is 2.0.0-beta like this one: https://github.com/kubeflow/pipelines/releases/tag/2.0.0b10

@kimkihoon0515
Copy link
Author

@zijianjoy Hey Thx for your help. I tried kfp version 2.0.0b2 and i got the screen that i wanted :)

@gkcalat gkcalat closed this as completed Jan 19, 2023
@pythonking6
Copy link

This needs to be re-opened because it is happening in version 2.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants