Skip to content

'injectFaultMean' doesn't work #42

Description

@ElaineYao

I got this following error. I noticed in the source code def injectFaultMean(a, b), there is a FIXME - This only works if we call np.mean on b[0]. Need to figure out why. I was wondering what this injection function wants to do and how to avoid this error, thanks.

UnknownError (see above for traceback): exceptions.IndexError: tuple index out of range
Traceback (most recent call last):

  File "/home/elaine/.conda/envs/tensorfi/lib/python2.7/site-packages/tensorflow/python/ops/script_ops.py", line 206, in __call__
    ret = func(*args)

  File "/home/elaine/pycharmProjects/TensorFI-master/TensorFI/injectFault.py", line 551, in injectFaultMean
    res = np.mean(a, b[0])

  File "/home/elaine/.conda/envs/tensorfi/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 2957, in mean
    out=out, **kwargs)

  File "/home/elaine/.conda/envs/tensorfi/lib/python2.7/site-packages/numpy/core/_methods.py", line 57, in _mean
    rcount = _count_reduce_items(arr, axis)

  File "/home/elaine/.conda/envs/tensorfi/lib/python2.7/site-packages/numpy/core/_methods.py", line 50, in _count_reduce_items
    items *= arr.shape[ax]

IndexError: tuple index out of range

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions