pymc-devs / pymc2

THIS IS THE **OLD** PYMC PROJECT (VERSION 2). PLEASE USE PYMC INSTEAD:
http://pymc-devs.github.com/pymc/
Other
879 stars 229 forks source link

pymc test failure #156

Closed bk801 closed 6 years ago

bk801 commented 7 years ago

I have followed the instruction for installation and testing of pymc. This generates failure report . I have included the report here. Any ides what is causing the failure? Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information.

import pymc
pymc.test()
Running unit tests for pymc.tests
NumPy version 1.12.1
NumPy relaxed strides checking option: True
NumPy is installed in C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy
Python version 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]
nose version 1.3.7
Warning (from warnings module):
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\InstantiationDecorators.py", line 101
(args, varargs, varkw, defaults) = inspect.getargspec(func)
DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
Warning (from warnings module):
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\CommonDeterministics.py", line 77
parent_values) = inspect.getargspec(lam_fun)
DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
Warning (from warnings module):
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\importlib_bootstrap.py", line 205
return f(*args, **kwds)
ImportWarning: can't resolve package from spec or package, falling back on name and path
......Could not generate output statistics for early_mean
Could not generate output statistics for early_mean
Could not generate output statistics for switchpoint
Could not generate output statistics for rate
Could not generate output statistics for late_mean
.........S..S.............S.......
Warning (from warnings module):
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\tests\test_database.py", line 449
progress_bar=0)
ResourceWarning: unclosed file <_io.TextIOWrapper name='testresults/interactivesqlite.log' mode='w' encoding='cp1252'>
.............................................................................................
Warning (from warnings module):
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\CommonDeterministics.py", line 849
'b': lambda a, b: np.log(a) * a ** b}
RuntimeWarning: invalid value encountered in log
0 x
1 (x_pow_2)
dtype: object
.....SS.....
Warning (from warnings module):
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\tests\test_interactive.py", line 22
progress_bar=0)
ResourceWarning: unclosed file <_io.TextIOWrapper name='testresults/interactive.log' mode='w' encoding='cp1252'>
...............[-----------------68%----- ] 680 of 1000 complete in 0.5 sec
[-----------------100%-----------------] 1000 of 1000 complete in 0.8 sec
.[-----------------100%-----------------] 1000 of 1000 complete in 0.3 sec
.E............

ERROR: Failure: ValueError (size is not compatible with inputs)

Traceback (most recent call last):
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\distributions.py", line 111, in newfun
return np.reshape(randfun(size=shape, *args, **kwargs), shape)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\distributions.py", line 869, in rbinomial
return np.random.binomial(np.ravel(n), np.ravel(p), size)
File "mtrand.pyx", line 3788, in mtrand.RandomState.binomial (numpy\random\mtrand\mtrand.c:32376)
File "mtrand.pyx", line 388, in mtrand.discnp_array (numpy\random\mtrand\mtrand.c:9960)
ValueError: size is not compatible with inputs

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\nose\failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\nose\loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\nose\importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\nose\importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\imp.py", line 234, in load_module
return load_source(name, filename, file)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\imp.py", line 172, in load_source
module = _load(spec)
File "", line 675, in _load
File "", line 655, in _load_unlocked
File "", line 678, in exec_module
File "", line 205, in _call_with_frames_removed
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\tests\test_special_methods.py", line 27, in 
pm.Binomial('x3', 100, .4),
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\distributions.py", line 320, in init
**arg_dict_out)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\PyMCObjects.py", line 764, in init
verbose=verbose)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\Node.py", line 214, in init
Node.init(self, doc, name, parents, cache_depth, verbose=verbose)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\Node.py", line 129, in init
self.parents = parents
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\Node.py", line 147, in _set_parents
self.gen_lazy_function()
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\PyMCObjects.py", line 794, in gen_lazy_function
self.value = self._random(**self._parents.value)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\distributions.py", line 114, in newfun
return randfun(size=shape, *args, **kwargs)
File "C:\Users\Bahram\AppData\Local\Programs\Python\Python36\lib\site-packages\pymc\distributions.py", line 869, in rbinomial
return np.random.binomial(np.ravel(n), np.ravel(p), size)
File "mtrand.pyx", line 3788, in mtrand.RandomState.binomial (numpy\random\mtrand\mtrand.c:32376)
File "mtrand.pyx", line 388, in mtrand.discnp_array (numpy\random\mtrand\mtrand.c:9960)
ValueError: size is not compatible with inputs

Ran 177 tests in 28.535s

FAILED (SKIP=5, errors=1)
<nose.result.TextTestResult run=177 errors=1 failures=0>
fonnesbeck commented 7 years ago

Could you please reformat this report to use markdown properly. Its pretty hard to read as presented.

What version of PyMC did you install, and from where?

bk801 commented 7 years ago

I can't get rid of bold type face when I cut and paste from Python environment. Sorry. other information you asked for are:

pymc was download from http://www.lfd.uci.edu/~gohlke/pythonlibs/ the version is pymc-2.3.6-cp36-cp36m-win_amd64.whl which was installed for Python 3.6.1

fonnesbeck commented 7 years ago

I've fixed it. You needed to use Markdown to make it work.

Did you mean to close this issue?

fonnesbeck commented 7 years ago

There may be a problem with that particular build. I am not familiar with those. I recommend using Anaconda and installing via:

conda install -c anaconda pymc=2.3.6

If that is not possible, try building PyMC from source:

pip install pymc
bk801 commented 7 years ago

Thanks for fixing the test.I need to learn the Markdown. I have installed on Anaconda and it works fine and I get Zero error. My problem is with the native Python in Windows 10. I will try installing pymc on Raspberry Pi and Mint ( installed on Virtual Box) in the next few days. Thanks for your help and guidance.

cgohlke commented 7 years ago

I can't reproduce this with the binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/

>>> pymc.__version__
'2.3.6'
>>> pymc.test()
Running unit tests for pymc.tests
NumPy version 1.11.3
NumPy relaxed strides checking option: False
NumPy is installed in X:\Python36\lib\site-packages\numpy
Python version 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]
nose version 1.3.7
<snip>
----------------------------------------------------------------------
Ran 192 tests in 24.417s

OK (SKIP=3)
<nose.result.TextTestResult run=192 errors=0 failures=0>

The issue might be specific to numpy 1.12.x.