Comments (7)
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.
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.
...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.
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.
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.
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.
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)
- support for Jax-like custom forward pass definition? HOT 1
- Gradient become Nan for 0 value test HOT 1
- Is it possible to see gradient function? HOT 2
- Four scipy tests are failing HOT 6
- Add np.float128,np.complex256 dtypes to vspaces and boxes registers HOT 2
- unsafe URL HOT 1
- Numpy 1.25 breaks a few linalg functions HOT 1
- `autograd` 1.6 breaks Apple M-series macOS and Windows builds (module `numpy` has no attribute `float128`) HOT 3
- Can I differentiate this function?
- Python 2 and dependency on future HOT 2
- `'ArrayBox' object has no attribute 'dot'` when differentiating function containing `x.dot(y)` HOT 1
- How do I create a scalar value that does not depend on the independent variables ?
- AttributeError: module 'autograd.numpy' has no attribute 'numpy_extra'
- Autograd for quantum circuits
- [BUG] Differentiating `autograd.numpy.linalg.norm` gives incorrect results
- Support for advanced library based on autograd HOT 4
- Release new version 1.6.3 on PyPI HOT 3
- autograd return nan with to norm function
- Saving `ArrayBox` to hdf5 file
- Incompatibility with numpy 2.0.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autograd.