Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy indexing warnings #6695

Open
twiecki opened this issue Mar 19, 2019 · 9 comments
Open

Numpy indexing warnings #6695

twiecki opened this issue Mar 19, 2019 · 9 comments

Comments

@twiecki
Copy link
Contributor

twiecki commented Mar 19, 2019

/Users/twiecki/anaconda3/lib/python3.6/site-packages/theano/tensor/basic.py:6592: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  result[diagonal_slice] = x
/Users/twiecki/anaconda3/lib/python3.6/site-packages/theano/tensor/subtensor.py:2339: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  out[0][inputs[2:]] = inputs[1]
/Users/twiecki/anaconda3/lib/python3.6/site-packages/theano/tensor/subtensor.py:2197: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  rval = inputs[0].__getitem__(inputs[1:])
/Users/twiecki/anaconda3/lib/python3.6/site-packages/theano/tensor/subtensor.py:2339: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  out[0][inputs[2:]] = inputs[1]
/Users/twiecki/anaconda3/lib/python3.6/site-packages/theano/tensor/basic.py:6592: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  result[diagonal_slice] = x
/Users/twiecki/anaconda3/lib/python3.6/site-packages/theano/tensor/subtensor.py:2197: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  rval = inputs[0].__getitem__(inputs[1:])
@atreyasha
Copy link

Hello @twiecki! I am also encountering the same issue, might be an internal theano issue?

@nouiz
Copy link
Member

nouiz commented Apr 11, 2019 via email

@twiecki
Copy link
Contributor Author

twiecki commented Apr 11, 2019

@nouiz Can you point me to where in the code this likely originates?

@nouiz
Copy link
Member

nouiz commented Apr 11, 2019 via email

@atreyasha
Copy link

It is also discussed as a numpy issue here: numpy/numpy#11411

@twiecki
Copy link
Contributor Author

twiecki commented Apr 12, 2019

@AtreyaSh Want to do a PR?

@atreyasha
Copy link

atreyasha commented Apr 13, 2019

@twiecki Yes we could do one. For me, I found the line causing the warning:

Which can be found here:

rval = inputs[0].__getitem__(inputs[1:])

The entire function is:

def perform(self, node, inputs, out_):
    out, = out_
    check_advanced_indexing_dimensions(inputs[0], inputs[1:])
    rval = inputs[0].__getitem__(inputs[1:]) # this is the line triggering the warning
    # When there are no arrays, we are not actually doing advanced
    # indexing, so __getitem__ will not return a copy.
    # Since no view_map is set, we need to copy the returned value
    if not any(isinstance(v.type, TensorType) and v.ndim > 0
               for v in node.inputs[1:]):
        rval = rval.copy()
    out[0] = rval

Any suggestions on what to change?

@twiecki
Copy link
Contributor Author

twiecki commented Apr 14, 2019

Hm, not sure what is going on there. Is inputs multidimensional?

@lucianopaz
Copy link
Contributor

Isn't it the same as #6667? I made the warnings be handled like exceptions to get the full trace. I don't know how to make a fix though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants