Coder Social home page Coder Social logo

Comments (7)

slinderman avatar slinderman commented on September 4, 2024

from ssm.

r-shruthi11 avatar r-shruthi11 commented on September 4, 2024

Thanks, Scott. I've tried that but I still see the same issue.

----> 1 import ssm

~/Desktop/Projects/state-space-models/ssm/ssm/ssm/init.py in
1 # Default imports for SSM
2
----> 3 from .hmm import *
4 from .lds import *

~/Desktop/Projects/state-space-models/ssm/ssm/ssm/hmm.py in
7
8 from ssm.optimizers import adam_step, rmsprop_step, sgd_step, convex_combination
----> 9 from ssm.primitives import hmm_normalizer, hmm_expected_states, hmm_filter, hmm_sample, viterbi
10 from ssm.util import ensure_args_are_lists, ensure_args_not_none,
11 ensure_slds_args_not_none, ensure_variational_args_are_lists, \

~/Desktop/Projects/state-space-models/ssm/ssm/ssm/primitives.py in
2 import autograd.numpy as np
3 import autograd.numpy.random as npr
----> 4 from autograd.scipy.misc import logsumexp
5 from autograd.scipy.linalg import cholesky_banded, solve_banded, solveh_banded
6 from autograd.extend import primitive, defvjp

ImportError: cannot import name 'logsumexp'

from ssm.

slinderman avatar slinderman commented on September 4, 2024

My guess is that Python is still loading the pip installed version of Autograd. You can check by running

import autograd
autograd.__file__

and seeing what path it's pointing to. Make sure it's the path from Github.

That said, I just double checked Autograd and it looks like @mattjj just uploaded the latest Github master to PyPI. You should be able to get it by running

pip install autograd --upgrade

from ssm.

r-shruthi11 avatar r-shruthi11 commented on September 4, 2024

Hi Scott,

I tried both - setting the autograd path to point to the Github directory and upgrading my install of autograd but I still see the same error when I try to import logsumexp from autograd.scipy.misc. However, importing logsumexp from autograd.scipy.special seems to work.

pip install autograd --upgrade
Requirement already up-to-date: autograd in /Users/shrumac2/miniconda3/envs/ssmodels/lib/python3.5/site-packages (1.3)
Requirement not upgraded as not directly required: numpy>=1.12 in /Users/shrumac2/miniconda3/envs/ssmodels/lib/python3.5/site-packages (from autograd) (1.16.4)
Requirement not upgraded as not directly required: future>=0.15.2 in /Users/shrumac2/miniconda3/envs/ssmodels/lib/python3.5/site-packages (from autograd) (0.17.1)

python
Python 3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 16:30:03)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from autograd.scipy.misc import logsumexp
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'logsumexp'
from autograd.scipy.special import logsumexp

logsumexp([1.0, 2.0, 3.0])
3.4076059644443806

from ssm.

slinderman avatar slinderman commented on September 4, 2024

Sorry for the delay. Quick update: I reran the Travis integrations and they are also failing in the same way you describe. Unfortunately I haven't been able to reproduce the problem locally yet, and I'm currently tied up at a conference so it might take a few more days.

In the meantime, it would be helpful to also know more about your configuration: what version of numpy/scipy are you on? I'm sure there's a simple explanation for all this...

from ssm.

r-shruthi11 avatar r-shruthi11 commented on September 4, 2024

Thanks for the update, Scott. Here's the info:

autograd==1.3
certifi==2019.6.16
cycler==0.10.0
Cython==0.29.13
future==0.17.1
joblib==0.13.2
kiwisolver==1.1.0
matplotlib==3.1.1
numpy==1.17.0
pyparsing==2.4.1.1
python-dateutil==2.8.0
scikit-learn==0.21.2
scipy==1.3.0
six==1.12.0
tqdm==4.32.2

from ssm.

slinderman avatar slinderman commented on September 4, 2024

Thanks for your patience. The fix was simple in the end: I had to change the imports to from autograd.scipy.special import logsumexp to work with the latest versions of scipy and autograd. Fix is here 57950a8.

Note: I also made these changes in the master branch of pybasicbayes and pyhsmm to fix the nosetests.

from ssm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.