orbit
orbit copied to clipboard
UnboundLocalError: local variable 'pool' referenced before assignment
lgt = LGT( response_col="Sales", date_col="Date", estimator='stan-mcmc', seasonality=12, seed=8888 ) lgt.fit(df)
When i using it in ipynb file i didn't get any error but when i am using in .py file i getting error as UnboundLocalError: local variable 'pool' referenced before assignment i try to change few things in _map_parallel function but it won't work can you help to achive mcmc
could you also provide python version and os you are using?
i am using Python 3.8.12 and windows 10
I experienced the same issue on Windows 10, Python 3.9.6, orbit-ml 1.1.1dev0.
Placing the code inside a main() function and using if __name__ == '__main__': main() seemed to work.
How did you format this code so that it would run and work? I am receiving the same error.
I can't share the code because it's work related, but the format was:
import ...
def main():
df = ...
model = LGT(
response_col=response_col,
date_col=date_col,
estimator='stan-mcmc',
seasonality=52,
)
model.fit(df)
if __name__ == '__main__':
main()
How did you format this code so that it would run and work? I am receiving the same error.
are you using the version from dev or from pypi ?
The problem happens in jupyter notebook and it's due to the varied behaviors of multiprocessing across different operating systems and python versions.
For solutions, please refer to this thread https://github.com/uber/orbit/issues/520#issuecomment-1077937181.
Also, execute the code via __main__ block might also dodge this issue.