Hi I am reaching out to understand an error that I...
# flyte-support
h
Hi I am reaching out to understand an error that I keep encountering with the simple training script provided in the flyte-school repo: https://github.com/unionai-oss/flyte-school/blob/main/00-intro/workflows/example_intro.py, for some reason the workflow notebook here: https://github.com/unionai-oss/flyte-school/blob/main/00-intro/workshop.ipynb keeps failing at the train step when I push to a local cluster in docker ie --remote , I am using python 3.10.12 environment, and following is the error :
Copy code
Traceback (most recent call last):

      File "/opt/venv/lib/python3.10/site-packages/flytekit/exceptions/scopes.py", line 165, in system_entry_point
        return wrapped(*args, **kwargs)
      File "/opt/venv/lib/python3.10/site-packages/flytekit/core/base_task.py", line 530, in dispatch_execute
        raise type(exc)(msg) from exc

Message:

    Failed to convert inputs of task 'workflows.example_intro.train_model':
  'NoneType' object has no attribute 'DESCRIPTOR'

SYSTEM ERROR! Contact platform administrators.
here is an image showing the execution
retrying the same run, runs everything perfectly, seems like model serialisation is broken or takes too long and hence mode training fails
c
i’m experiencing the same issue! re-running the task also succeeded in only 17 seconds. it seems a little suspect but it did output a “single (SklearnEstimator) blob”
I narrowed it down to the Hyperparameters definition. I think it’s an older way of doing things that doesn’t work on newer Flyte installations. The docs say > If you’re using Flytekit version < v1.11.1, you will need to add
from dataclasses_json import dataclass_json
to your imports and decorate your dataclass with
@dataclass_json
. which it seems like flyte-school is using. Just removing
@dataclass_json
didn’t make it work for me, thought. But this test workflow runs fine on flyte v1.15.3:
Copy code
from dataclasses import dataclass
from datetime import datetime
from typing import Optional

import flytekit as fl


@dataclass
class Datum:
    x: int
    y: Optional[int]


@fl.task()
def multiply(x: int, y: Optional[int]) -> Datum:
    print(f"[{datetime.now()}] multiplying {x} by {y}")
    return Datum(x=x*y, y=None)


@fl.task()
def add(d: Datum) -> Datum:
    print(f"[{datetime.now()}] adding {d.x} by {d.y}")
    return Datum(x=0, y=d.x+9)


@fl.workflow
def wkflw() -> Optional[int]:
    d = multiply(x=2,y=10)
    r = add(d)
    return r.y