Reputation: 35
Here's a batch prediction case using multiprocessing. Steps:
After with mp.Pool(processes=num_processes) as pool
, there's a with Dataset(dataset_code) as data
in the main process using websocket to get data, and it works well.
Then goes to the multiprocessing mission with
result = pool.apply_async(pred_data_from_db, args=(start_index, chunk))
predict = getattr(module, customized_pred_func_name)
Other Information:
the model has been loaded before multiprocessing starts
there is a flask interface for other services to know the progress of the batch prediction
this issue will not happen when predicting with an svm pkl model
I already set the n_job to 1
I hope I can find ways to locate the problem
Upvotes: 0
Views: 16