Giter VIP home page Giter VIP logo

Comments (7)

dougalm avatar dougalm commented on August 28, 2024

Hi Andy, thanks for the bug report and for the nice minimal test case!

I think the issue is with numpy versions. Your test case works fine on my system, which has numpy 1.9.1. Is it possible that you're using an older version of numpy? Numpy's ufunc.add.at is supposed to support slices but maybe older versions don't? We ought to figure out which versions work and either list them as dependencies or implement a fallback option.

I added a version of your test to our test suite. Can you confirm that this test fails for you?

from autograd.

a1k0n avatar a1k0n commented on August 28, 2024

Hmm! It seems to be a Mac system numpy issue on my end, with both Yosemite and El Capitan.

I have two computers (both Macs), one Yosemite with numpy 1.10.0.post2 and one El Capitan with 1.8.0rc1, and both fail the test. Both also segfault trying to run nosetests.

I have an AWS node running Ubuntu with numpy 1.10.1 and that works just fine. And a Raspberry Pi 2 with numpy 1.10.1, also works fine.

El Capitan prevents me from upgrading the system numpy. If I upgrade to numpy 1.10.1 in a virtualenv, it works fine. And running nosetests no longer segfaults (though there are other unit test failures... I can open separate issues on those if you wish?)

from autograd.

a1k0n avatar a1k0n commented on August 28, 2024

...and on Yosemite I just upgraded to numpy 1.10.1, and I still get the same error, so it's definitely the mac system python that is unhappy about this, somehow. Weird. I'll dig a little more.

from autograd.

a1k0n avatar a1k0n commented on August 28, 2024

Ok, yeah, this is definitely a mac system numpy issue, nothing to do with autograd. Minimal test case is

np.add.at(np.zeros(2), slice(0, 2), 1)

Closing.

It turns out that the system Python includes numpy 1.8.0rc1, and attempting to upgrade it with pip actually doesn't work.

Thanks @dougalm for a really great library!

from autograd.

a1k0n avatar a1k0n commented on August 28, 2024

Ah, hang on.

I was just checking the version dependency you brought up in your original comment, numpy==1.8.0 also fails the test, as does 1.8.1 and 1.8.2! 1.9.0 is actually the first version which passes the test.

So... I guess maybe the minimum requirement should be bumped up after all.

from autograd.

mattjj avatar mattjj commented on August 28, 2024

Thanks for the thorough testing! I bumped the numpy version requirement in setup.py to 1.9, hopefully that's the fix you had in mind.

from autograd.

a1k0n avatar a1k0n commented on August 28, 2024

Indeed it was, thanks!

I suppose it would be possible to support 1.8 by expanding the slice object but it's definitely not worth it.

from autograd.

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.