Hi everyone! Did anyone manage to get the getting ...
# ask-the-community
m
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
hi @Max Mathys, could you downgrade your fsspec to < 2023.10.0?
k
We should pin it and release a version
c
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
@CP, are you sending
--remote
to the
pyflyte run
command?
c
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
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
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
The Python version is 3.11. And yes, that’s the code!
s
I'm able to run it successfully. can you delete your venv and reinstall your requirements?