cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle AsyncTimeoutError using python API?

Jenny
Blue LED

I want to wait for end of model train of different sample size without timeout.
How to handle AsyncTimeoutError using python API?

>>python
model_job_id = model.train(
sample_pct=100
,featurelist_id=featurelist_id
)
model_fair_100pct = dr.models.modeljob.wait_for_async_model_creation(project.id, model_job_id)
>>error
raise errors.AsyncTimeoutError(timeout_msg)
datarobot.errors.AsyncTimeoutError: Model creation timed out in 600 seconds 

3 Replies
IraWatt
DC Motor

Hi @Jenny,

Had a look through the Python API docs 'wait_for_async_model_creation' has a parameter of 'max_wait=600'. Try upping it to 6000 see if the error changes (or hopefully goes away):

 

model_fair_100pct = dr.models.modeljob.wait_for_async_model_creation(project.id, model_job_id, max_wait=6000)

 

 All the best,

Ira

Jenny
Blue LED

Hi @IraWatt ,

 

Thanks for your response.

There is default value of max_wait. ( 'max_wait=600')

I'll try it and reply if resolved later!

 

IraWatt
DC Motor

Just had a similar question on the API with R, the max_wait parameter worked. However, setting max_wait to a very large value also caused issues.