pyhsmm
pyhsmm copied to clipboard
scipy's logsumexp moved in Scipy 0.19.0
In scipy==0.19.0, the misc
module was removed so scipy.misc.logsumexp
becomes scipy.special.logsumexp
. Six imports need fixed to resolve that.
One option is
try:
from scipy.special import logsumexp
except ImportError:
from scipy.misc import logsumexp # removed in scipy 0.19.0
Otherwise, pin scipy>=0.19.0.
Ran the following bash snippet in my anaconda python's site-packages directory:
~/anaconda3/lib/python3.6/site-packages$
FILES=$(find pyhsmm pybasicbayes -name "*.py")
for FILE in $FILES
do
echo $FILE
sed -i s/"from scipy.misc import logsumexp"/"from scipy.special import logsumexp"/g $FILE
done
python -c "import pyhsmm" # Should work now
@satpreetsingh Condolences.
hello to all,
I am trying to set up the pyhsmmon
my Windows x64 (python3.6), but when I tyr to run the examples, I get:
ImportError: No module named 'hmm_messages_interface'
colud you give me your environment?
This is still an issue when installing from pip as of 04/08/2020, but is fixed when install from the git repo.
@Wusir2018 are you installing from pip or from the git repo? If the latter, what compiler are you using? I saw similar issues when trying to install from the repo due to this issue. Try applying the fix suggested there to pyhssm/internals/util.h then installing again.
Hi @johnmbarrett,
I installed from pip
.
Thank you for you reply! I am so sorry about reply you late.
I gave up using this project because I didn't install it successfully.
Thank you very much! I will try it from git
again!
I solved the issue by brute force. First I downloaded the package from Github on my laptop. Then I replaced from scipy.misc import logsumexp
with from scipy.special import logsumexp
in the following files: \pyhsmm\models.py \pybasicbayes\util\stats.py \pybasicbayes\distributions\negativebinomial.py \pybasicbayes\models\mixture.py. In the command prompt of windows python setup.py install
. My set up is Windows 10 with Python 3.9.5.
hey @KristanRomano would you be willing to write and submit a PR incorporating the changes you made?
@mathDR I am actually pretty new to python and github. So I don't know how to satisfy your request. Maybe @mattjj might help you. I would also like to know his opinion on the solution I provided.
Oh, okay. If you have a working solution to fix the logsumexp issue, you can do the following:
- clone the repo locally
- create a new branch (called something like: fix_logsumexp_issue_pyhsmm) from the main/master branch
- implement your changes there
- push those changes back to pyhsmm
- generate a "pull request" and tag some people (feel free to tag me) to review.
- Once reviewed, @mattjj can merge that code into main/master
Note, this is a typical workflow for adding new capabilities/ fixing bugs etc. to a repo. Please tag me with any questions if you want help working through the steps