https://flyte.org logo
#ask-the-community
Title
# ask-the-community
m

Max Mathys

11/13/2023, 1:30 PM
Hi everyone! Did anyone manage to get the getting started guide running? I am facing this issue: https://github.com/flyteorg/flyte/issues/4414
s

Samhita Alla

11/13/2023, 1:51 PM
hi @Max Mathys, could you downgrade your fsspec to < 2023.10.0?
k

Ketan (kumare3)

11/13/2023, 3:47 PM
We should pin it and release a version
c

CP

11/14/2023, 12:49 PM
hi! I tried downgrading the version which got rid of the error. However, the execution didn't show up in the Flyte UI 🤔 https://github.com/flyteorg/flyte/issues/4414#issuecomment-1810061275
s

Samhita Alla

11/14/2023, 1:51 PM
@CP, are you sending
--remote
to the
pyflyte run
command?
c

CP

11/14/2023, 1:55 PM
nope, I've just ran
pyflyte run example_fyte.py training_workflow --hyperparameters '{"C": 0.1}'
, as in the tutorial, but will give it a go!
Copy code
❯ pyflyte run --remote example_fyte.py training_workflow --hyperparameters '{"C": 0.1}'
Running Execution on Remote.

[✔] Go to <http://localhost:30080/console/projects/flytesnacks/domains/development/executions/f6b8aabfdcb2a42639ab> to see execution in the console.
Indeed, seems to be working now! Without
--rmeote
I was missing the
[✔] Go to <http://localhost:30080/console/projects/flytesnacks/domains/development/executions/f6b8aabfdcb2a42639ab> to see execution in the console.
m

Max Mathys

11/14/2023, 4:40 PM
Hi, the command still doesn’t work for me, I am getting the following error:
Copy code
FlyteScopedUserException: 'target'                                                                                                                                                                                                                                           
Failed with Unknown Exception <class 'KeyError'> Reason: 'Encountered error while executing workflow \'example.training_workflow\':\n  "Error encountered while executing \'training_workflow\':\\n  \'target\'"'
'Encountered error while executing workflow \'example.training_workflow\':\n  "Error encountered while executing \'training_workflow\':\\n  \'target\'"'
I would like to execute the script locally (not remotely like @CP). As said, I followed the instructions from the getting started guide. Can someone help me out?
s

Samhita Alla

11/15/2023, 8:39 AM
is this the workflow you're trying to run?
Copy code
import pandas as pd
from sklearn.datasets import load_wine
from sklearn.linear_model import LogisticRegression

import flytekit.extras.sklearn
from flytekit import task, workflow


@task
def get_data() -> pd.DataFrame:
    """Get the wine dataset."""
    return load_wine(as_frame=True).frame

@task
def process_data(data: pd.DataFrame) -> pd.DataFrame:
    """Simplify the task from a 3-class to a binary classification problem."""
    return data.assign(target=lambda x: x["target"].where(x["target"] == 0, 1))

@task
def train_model(data: pd.DataFrame, hyperparameters: dict) -> LogisticRegression:
    """Train a model on the wine dataset."""
    features = data.drop("target", axis="columns")
    target = data["target"]
    return LogisticRegression(max_iter=3000, **hyperparameters).fit(features, target)
what's the python version?
m

Max Mathys

11/15/2023, 1:15 PM
The Python version is 3.11. And yes, that’s the code!
s

Samhita Alla

11/15/2023, 1:32 PM
I'm able to run it successfully. can you delete your venv and reinstall your requirements?
4 Views