I am trying to automatically generate several notebooks with papermill using the following code:
template = "preprocessing_template.ipynb"
parameters = {"allowed_values":[0,1], "epsilon":0.01, "to_csv":True}
kernel_name = "my_env"
grid_folders_csv_names_outputs = [("dir_a", "a.csv","output_a.ipynb"),\
("dir_b", "b.csv","output_b.ipynb"),\
("dir_c", "c.csv","output_c.ipynb"),
[
def execute_notebook(template,output_file,parameters,kernel_name,grid_folder,csv_name):
parameters["grid_folder"]=grid_folder
parameters["csv_name"]=csv_name
nb = pm.execute_notebook(template,
output_file,
parameters=parameters,
kernel_name=kernel_name)
#nbs = []
#nbs.append(nb)
return nb
for grid_folder, csv_name, output_file in tqdm(grid_folders_csv_names_outputs):
execute_notebook(template,output_file,parameters,kernel_name,grid_folder,csv_name)
Nevertheless, I get an error message
DeadKernelError: Kernel died
which seems to happen because the memory is completely flooded. As I have checked by monitoring the system while running the code, several ZMQbg processes are started and never killed. What could I do to solve this issue? I am using Ubuntu 18.04 and the code is run in an anaconda 2019.10 environment.
Are you using papermill 2.0? I think there's a bug in the upstream nbclient that I am tracking down for the process leak. If you are on that version it should be fixed in the nbclient 0.2 release (might ask you to test it after we make the fix for the known issue).
Yes, I am using papermill 2.0.0. Let me know about the new version, I will be glad to test it.
i've been encountering this issue as well intermittently and so i'll follow this thread as well and am happy to test. thank you!
Sorry, been a little slow getting that release wrapped up. Will post here after it releases so people can test / report in any further isssues.
@lwasser @linneuholanda Try installing papermill 2.1 (or nbclient 0.2). The issue should be resolved now.
@MSeal just checking in . do you plan to update conda-forge to papermill 2.1? i just noticed our ci builds aren't updating as conda-forge seems to be at 2.0.0. Many thanks!!
That was supposed to automatically promote in conda-forge. Thanks for raising, I got the feed recipe PR running now to pull the latest version.
yay! thank you @MSeal !! 馃挴
Should be available now (haven't tested a local install yet)
i see it there @MSeal i'll update our docker container and will try it out. again - THANK YOU.
Most helpful comment
That was supposed to automatically promote in conda-forge. Thanks for raising, I got the feed recipe PR running now to pull the latest version.