C3W1 A1Q6 Unexpexted keyword argument

init() got an unexpected keyword argument ‘eval_task’.

I​ hava no idea as to why is it throwing this error. pls help!!!

1 Like

Hi! This error could be because of the squared brackets around the eval_task argument.
Try changing the training_loop definition as follows:
training_loop = train_model(model, train_task, eval_task, 100, output_dir_expand)

I ran into this exact problem for C3W3 UNQ_C3 as well and solved it by changing eval_task to eval_tasks because it seems like the init argument for trax.supervised.training.Loop in trax.supervised — Trax documentation is eval_tasks and not eval_task. Putting this here in case someone else runs into this problem as well.

That is not the cause of the error. Passing a list of eval tasks as [eval_task] to train_modelis correct. Using the brackets again inside the function is not (doing so creates a list of lists). However, the error that is causing the Unexpected keyword exception is correctly identified by @haheli857 (above) which is the use of a wrong parameter name. It should be eval_tasks plural. Because eval_task singular is, well, an unexpected keyword.