The lunar lander tutorial's pool() function runs into error with using non-built-in function, simulate(), in __main__, when ran on VsCode's jupyter notebook.
AttributeError: Can't get attribute 'simulate' on <module '__main__' (built-in)>
The cause is as mentioned here. I was able to get around this issue by moving simulate() into its own file, pool_functions, then importing before passing into pool
import pool_functions
for itr in trange(1, total_itrs + 1, file=sys.stdout, desc='Iterations'):
...
# Evaluate the models and record the objectives and measures.
with multiprocessing.Pool(workers) as pool:
results = pool.starmap(pool_functions.simulate, [(model, env_seed) for model in sols])
Not sure if this should be merged into master, as I have so far only ran into the issue and been able to test it on my MacBook.
Description
The lunar lander tutorial's pool() function runs into error with using non-built-in function,
simulate()
, in__main__
, when ran on VsCode's jupyter notebook.AttributeError: Can't get attribute 'simulate' on <module '__main__' (built-in)>
The cause is as mentioned here. I was able to get around this issue by moving
simulate()
into its own file,pool_functions
, then importing before passing intopool
Not sure if this should be merged into
master
, as I have so far only ran into the issue and been able to test it on my MacBook.