np.average crashes for 1D decimal object array · Issue #8696 ...
github.com › numpy › numpyFeb 25, 2017 · When using the decimal package with NumPy, the arrays are of type 'object'. While most operations are performed flawlessly, calling np.average() with one of these arrays throws an error if weights are not provided ( AttributeError: 'decimal.Decimal' object has no attribute 'dtype' ), and a different error if weights are provided ( AttributeError: 'bool' object has no attribute 'any' ).
numpy.average — NumPy v1.23.dev0 Manual
numpy.org › reference › generatednumpy.average(a, axis=None, weights=None, returned=False) [source] ¶. Compute the weighted average along the specified axis. Parameters. aarray_like. Array containing data to be averaged. If a is not an array, a conversion is attempted. axisNone or int or tuple of ints, optional. Axis or axes along which to average a.
numpy/extras.py at main · numpy/numpy · GitHub
github.com › numpy › numpyscl = wgt. sum (axis = axis, dtype = result_dtype) avg = np. multiply (a, wgt, dtype = result_dtype). sum (axis) / scl: if returned: if scl. shape!= avg. shape: scl = np. broadcast_to (scl, avg. shape). copy return avg, scl: else: return avg: def median (a, axis = None, out = None, overwrite_input = False, keepdims = False): """ Compute the median along the specified axis.
AttributeError: 'COCO' object has no attribute 'get_cat_ids ...
github.com › open-mmlab › mmdetectionJun 05, 2020 · sys.platform: linux Python: 3.7.6 (default, Jan 8 2020, 19:59:22) [GCC 7.3.0] CUDA available: True CUDA_HOME: /usr NVCC: Cuda compilation tools, release 10.1, V10.1.243 GPU 0: GeForce GTX 1070 GCC: gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0 PyTorch: 1.5.0 PyTorch compiling details: PyTorch built with: - GCC 7.3 - C++ Version: 201402 - Intel(R) Math Kernel Library Version 2020.0.0 Product Build ...