cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle AsyncTimeoutError using python API?

How to handle AsyncTimeoutError using python API?

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 

1 Solution

Accepted Solutions

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

View solution in original post

3 Replies

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

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!

 

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.