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

Getting TypeError: __init__() takes 2 positional arguments but 4 were given #254

Open
minyoungjeong0812 opened this issue Feb 6, 2024 · 1 comment

Comments

@minyoungjeong0812
Copy link

Hi, I am following your made-with-ML tutorial and currently at the experiment tracking step. When I ran the following code after specifying a run config based on ML flow callbacks, I am getting Getting TypeError: init() takes 2 positional arguments but 4 were given . Could you please help?

# Dataset
ds = load_data()
train_ds, val_ds = stratify_split(ds, stratify="tag", test_size=test_size)

# Preprocess
preprocessor = CustomPreprocessor()
train_ds = preprocessor.fit_transform(train_ds)
val_ds = preprocessor.transform(val_ds)
train_ds = train_ds.materialize()
val_ds = val_ds.materialize()

# Trainer
trainer = TorchTrainer(
    train_loop_per_worker=train_loop_per_worker,
    train_loop_config=train_loop_config,
    scaling_config=scaling_config,
    run_config=run_config,  # uses RunConfig with MLflow callback
    datasets={"train": train_ds, "val": val_ds},
    dataset_config=dataset_config,
    preprocessor=preprocessor,
)

# Train
results = trainer.fit()
@bvahdat
Copy link

bvahdat commented Mar 17, 2024

Hi @minyoungjeong0812

I ran into the same error which seems to be a bug in ray release 2.7.0 being fixed in 2.7.1:

https://github.com/ray-project/ray/releases/tag/ray-2.7.1

I just upgraded to the version 2.7.1 here and got it properly working after updating the dependencies.

python3 -m pip install -r requirements.txt

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

No branches or pull requests

2 participants