UNQ_C4 Learner Error: Grader timed out

Hi, the code runs smoothly, but kernel with unit tests runs forever; I’m also getting Learner Error: Grader timed out after submitting it

Do you have any idea why following code could cause this?

bare_train_generator = data_generator(batch_size=2, max_length=10, data_lines=lines)
infinite_train_generator = itertools.cycle(bare_train_generator)

bare_eval_generator = data_generator(batch_size=2, max_length=10, data_lines=lines)
infinite_eval_generator = itertools.cycle(bare_eval_generator)

train_task = training.TrainTask( 
    labeled_data=infinite_train_generator, # Use infinite train data generator
    loss_layer= tl.CrossEntropyLoss(),   # Don't forget to instantiate this object
    optimizer=trax.optimizers.Adam(learning_rate = 0.0005)      # Don't forget to add the learning rate parameter TO 0.0005

eval_task = training.EvalTask( 
    labeled_data=infinite_eval_generator,    # Use infinite eval data generator
    metrics=[tl.CrossEntropyLoss() , tl.Accuracy()], # Don't forget to instantiate these objects
    n_eval_batches=3  # For better evaluation accuracy in reasonable time 

training_loop = training.Loop(model, 



# We return this because it contains a handle to the model, which has the weights etc.
return training_loop

Hi charmquark,

Try to use parameternames rather than hardcode values.

1 Like