Skip to content

Reporting errors when run the mixturemodel example #8

@Yanhui85

Description

@Yanhui85

Hello:
I have installed the PyDREAM package on Windows 10, when run the mixturemodel example, I get the following error:

multiprocess.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Lib\site-packages\multiprocess\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "C:\ProgramData\Anaconda3\Lib\site-packages\multiprocess\pool.py", line 44, in mapstar
return list(map(*args))
File "C:\ProgramData\Anaconda3\Lib\site-packages\pydream\core.py", line 119, in _sample_dream
raise e
File "C:\ProgramData\Anaconda3\Lib\site-packages\pydream\core.py", line 105, in _sample_dream
sampled_params[iteration], log_prior , log_like = step_fxn(q0)
File "C:\ProgramData\Anaconda3\Lib\site-packages\pydream\Dream.py", line 406, in astep
raise e
File "C:\ProgramData\Anaconda3\Lib\site-packages\pydream\Dream.py", line 254, in astep
self.last_prior, self.last_like = self.logp(q0)
File "C:\ProgramData\Anaconda3\Lib\site-packages\pydream\model.py", line 31, in total_logp
loglike = self.likelihood(q0)
File "D:\Python_codes\PyDREAM-master\pydream\examples\mixturemodel\mixturemodel.py", line 39, in likelihood
log_lh = np.zeros((k))
NameError: name 'np' is not defined
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\Python_codes\PyDREAM-master\pydream\examples\mixturemodel\mixturemodel.py", line 64, in
sampled_params, log_ps = run_dream([params], likelihood, niterations=niterations, nchains=nchains, start=starts, start_random=False, save_history=True, history_file='mixturemodel_seed.npy', multitry=5, parallel=False)
File "C:\ProgramData\Anaconda3\Lib\site-packages\pydream\core.py", line 74, in run_dream
returned_vals = pool.map(_sample_dream, args)
File "C:\ProgramData\Anaconda3\Lib\site-packages\multiprocess\pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "C:\ProgramData\Anaconda3\Lib\site-packages\multiprocess\pool.py", line 644, in get
raise self._value
NameError: name 'np' is not defined

It seems that the errors are due to the multiprocessing pool.map(), maybe there are some differences of this function when it is run on Linux and Windows, but I donot known how to fix it. Would you please help me with this?

Thank you very much for your help
Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions