Skip to content

numpy meshgrid error #9943

@auroua

Description

@auroua

I use meshgrid to generate some 2-d points, but sometimes calls this function raise the following error:

Exception ignored in: <generator object broadcast_arrays.<locals>.<genexpr> at 0x7fd41712b570>
Traceback (most recent call last):
  File "/usr/software/anaconda3/lib/python3.6/site-packages/numpy/lib/stride_tricks.py", line 251, in <genexpr>
    if all(array.shape == shape for array in args):
SystemError: error return without exception set
Exception ignored in: <generator object broadcast_arrays.<locals>.<genexpr> at 0x7fd41712b518>
Traceback (most recent call last):
  File "/usr/software/anaconda3/lib/python3.6/site-packages/numpy/lib/stride_tricks.py", line 251, in <genexpr>
    if all(array.shape == shape for array in args):
SystemError: error return without exception set
Exception ignored in: <generator object broadcast_arrays.<locals>.<genexpr> at 0x7fd41712b678>
Traceback (most recent call last):
  File "/usr/software/anaconda3/lib/python3.6/site-packages/numpy/lib/stride_tricks.py", line 251, in <genexpr>
    if all(array.shape == shape for array in args):
SystemError: error return without exception set

My code is like this:

  shift_x = np.arange(0, width) * feat_stride    # feat_stride=16  
  shift_y = np.arange(0, height) * feat_stride
  shift_x, shift_y = np.meshgrid(shift_x, shift_y)

The above error is not reported everytime I run the code.
How to avoid this error.
My numpy version is 1.13.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions