probcomp / crosscat

A domain-general, Bayesian method for analyzing high-dimensional data tables
http://probcomp.csail.mit.edu/crosscat/
Apache License 2.0
322 stars 42 forks source link

pls help run on windows 10 machine with anaconda python 2.7 #103

Open Sandy4321 opened 8 years ago

Sandy4321 commented 8 years ago

the error is

c:\Sander\my_code\crosscat-master> c:\Sander\my_code\crosscat-master>python examples/dha_example.py www/data/dha.csv --num_chains 2 --num_transitions 2 Traceback (most recent call last): File "examples/dha_example.py", line 78, in X_L_list, X_D_list = engine.initialize(M_c, M_r, T, get_next_seed(), initialization='from_the_prior', n_chains=num_chains) File "C:\Anaconda\lib\site-packages\crosscat\LocalEngine.py", line 110, in initialize make_get_next_seed(seed), File "C:\Anaconda\lib\site-packages\crosscat\LocalEngine.py", line 62, in get_initialize_arg_tuples seeds = [get_next_seed() for seed_idx in range(n_chains)] File "C:\Anaconda\lib\site-packages\crosscat\LocalEngine.py", line 908, in return lambda: generator.next() File "C:\Anaconda\lib\site-packages\crosscat\utils\general_utils.py", line 95, in intgenerator for in xrange(2**62): OverflowError: Python int too large to convert to C long

c:\Sander\my_code\crosscat-master>

alxempirical commented 8 years ago

Hi, Sandy. As a temporary workaround, try editing line 95 of C:\Anaconda\lib\site-packages\crosscat\utils\general_utils.py so that the argument to xrange is 2**31, or perhaps a smaller value.

riastradh-probcomp commented 8 years ago

Why not just change for _ in xrange(2**62) to while True?

alxempirical commented 8 years ago

You're right, that's a better solution. Can't remember why I wrote it that way.