You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/09/06 06:27:56 UTC

[GitHub] [incubator-mxnet] dwSun opened a new issue #16110: ndarray treated uint8 as signed value

dwSun opened a new issue #16110: ndarray treated uint8 as signed value
URL: https://github.com/apache/incubator-mxnet/issues/16110
 
 
   ## Description
   ndarray treated uint8 as signed value, cause nd.mean and nd.sum return confused values.
   
   ## Environment info (Required)
   
   ```
   ----------Python Info----------
   Version      : 3.7.4+
   Compiler     : GCC 9.2.1 20190827
   Build        : ('default', 'Sep  4 2019 08:03:05')
   Arch         : ('64bit', 'ELF')
   ------------Pip Info-----------
   Version      : 19.2.3
   Directory    : /home/david/.local/lib/python3.7/site-packages/pip
   ----------MXNet Info-----------
   Version      : 1.5.0
   Directory    : /home/david/.local/lib/python3.7/site-packages/mxnet
   Commit Hash   : 75a9e187d00a8b7ebc71412a02ed0e3ae489d91f
   Library      : ['/home/david/.local/lib/python3.7/site-packages/mxnet/libmxnet.so']
   Build features:
   ✖ CUDA
   ✖ CUDNN
   ✖ NCCL
   ✖ CUDA_RTC
   ✖ TENSORRT
   ✔ CPU_SSE
   ✔ CPU_SSE2
   ✔ CPU_SSE3
   ✔ CPU_SSE4_1
   ✔ CPU_SSE4_2
   ✖ CPU_SSE4A
   ✔ CPU_AVX
   ✖ CPU_AVX2
   ✖ OPENMP
   ✖ SSE
   ✔ F16C
   ✖ JEMALLOC
   ✖ BLAS_OPEN
   ✖ BLAS_ATLAS
   ✖ BLAS_MKL
   ✖ BLAS_APPLE
   ✔ LAPACK
   ✔ MKLDNN
   ✔ OPENCV
   ✖ CAFFE
   ✖ PROFILER
   ✔ DIST_KVSTORE
   ✖ CXX14
   ✖ INT64_TENSOR_SIZE
   ✔ SIGNAL_HANDLER
   ✖ DEBUG
   ----------System Info----------
   Platform     : Linux-5.2.0-2-amd64-x86_64-with-debian-bullseye-sid
   system       : Linux
   node         : Zarus
   release      : 5.2.0-2-amd64
   version      : #1 SMP Debian 5.2.9-2 (2019-08-21)
   ----------Hardware Info----------
   machine      : x86_64
   processor    : 
   Architecture:                    x86_64
   CPU op-mode(s):                  32-bit, 64-bit
   Byte Order:                      Little Endian
   Address sizes:                   39 bits physical, 48 bits virtual
   CPU(s):                          4
   On-line CPU(s) list:             0-3
   Thread(s) per core:              2
   Core(s) per socket:              2
   Socket(s):                       1
   NUMA node(s):                    1
   Vendor ID:                       GenuineIntel
   CPU family:                      6
   Model:                           78
   Model name:                      Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
   Stepping:                        3
   CPU MHz:                         2700.094
   CPU max MHz:                     3100.0000
   CPU min MHz:                     400.0000
   BogoMIPS:                        5184.00
   Virtualization:                  VT-x
   L1d cache:                       64 KiB
   L1i cache:                       64 KiB
   L2 cache:                        512 KiB
   L3 cache:                        4 MiB
   NUMA node0 CPU(s):               0-3
   Vulnerability L1tf:              Mitigation; PTE Inversion; VMX conditional 
                                    cache flushes, SMT vulnerable
   Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT vulnerab
                                    le
   Vulnerability Meltdown:          Mitigation; PTI
   Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabl
                                    ed via prctl and seccomp
   Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __
                                    user pointer sanitization
   Vulnerability Spectre v2:        Mitigation; Full generic retpoline, IBPB co
                                    nditional, IBRS_FW, STIBP conditional, RSB 
                                    filling
   Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep
                                     mtrr pge mca cmov pat pse36 clflush dts ac
                                    pi mmx fxsr sse sse2 ss ht tm pbe syscall n
                                    x pdpe1gb rdtscp lm constant_tsc art arch_p
                                    erfmon pebs bts rep_good nopl xtopology non
                                    stop_tsc cpuid aperfmperf tsc_known_freq pn
                                    i pclmulqdq dtes64 monitor ds_cpl vmx est t
                                    m2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_
                                    1 sse4_2 x2apic movbe popcnt tsc_deadline_t
                                    imer aes xsave avx f16c rdrand lahf_lm abm 
                                    3dnowprefetch cpuid_fault epb invpcid_singl
                                    e pti ssbd ibrs ibpb stibp tpr_shadow vnmi 
                                    flexpriority ept vpid ept_ad fsgsbase tsc_a
                                    djust bmi1 avx2 smep bmi2 erms invpcid mpx 
                                    rdseed adx smap clflushopt intel_pt xsaveop
                                    t xsavec xgetbv1 xsaves dtherm ida arat pln
                                     pts hwp hwp_notify hwp_act_window hwp_epp 
                                    md_clear flush_l1d
   ----------Network Test----------
   Setting timeout: 10
   Error open MXNet: https://github.com/apache/incubator-mxnet, <urlopen error timed out>, DNS finished in 0.008043289184570312 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 5.7149 sec, LOAD: 3.8721 sec.
   Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0061 sec, LOAD: 5.9587 sec.
   Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 2.2922 sec, LOAD: 2.9530 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0049 sec, LOAD: 6.0688 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.6523 sec, LOAD: 6.3915 sec.
   ----------Environment----------
   MXNET_GLUON_REPO="https://apache-mxnet.s3.cn-north-1.amazonaws.com.cn/"
   
   
   ```
   
   MXNet commit hash:
   mxnet 1.5.0/mxnet-mkl 1.5.0 from pypi
   
   ## Error Message:
   ```
   
   [[  5.294428    19.753687     2.9129395   -2.5185385   -1.155032
      -6.891398   -16.283634    -5.258693    12.444517   -15.217099  ]
    [  4.467552    13.287535    -6.7897177    9.952799   -17.748144
       9.615101    10.331182    -9.691498     7.053824     3.858751  ]
    [  8.588345    14.128191     2.2292066   -0.37398154 -16.75896
      -3.6744096   15.789112     5.5693245   -1.6635184    7.5760455 ]
    [-21.0087      14.59469     -7.3380384   12.308794   -12.248136
      -4.4694705    2.2953715    8.206869    -8.119482   -16.533562  ]
    [ -2.3286128    8.479254     2.4789157   -2.3277745  -12.434951
       4.725236    11.108866    -9.104659     4.9650497    9.33392   ]
    [ -3.731841    17.288551    12.867422     9.241861    -7.0637894
      -8.470987    11.176862     6.910103   -10.083654    -1.5754144 ]
    [  9.5148     -12.331816    12.547187    -3.6398468   -7.9638
       6.387233    -9.360783    -8.548329     4.958392     7.5018935 ]
    [ -3.1119134    5.478961     4.9376755    0.06427763   6.5914135
      14.644599    13.104069     7.305216     0.3420452   13.658117  ]
    [ -2.2189102    4.075518     3.6359587  -19.651363   -13.7345495
       3.9397633  -10.489504    -9.577133    10.861511    -1.9959427 ]
    [ -5.451889     7.281857   -11.602234    -6.9258833    7.8813524
       7.1631193    3.386241    -0.57300234  10.91308     -8.4325485 ]]
   <NDArray 10x10 @cpu(0)>
   
   [0.8853544]
   <NDArray 1 @cpu(0)> 
   [88.53544]
   <NDArray 1 @cpu(0)>
   
   [[  5  19   2 254 255 250 240 251  12 241]
    [  4  13 250   9 239   9  10 247   7   3]
    [  8  14   2   0 240 253  15   5 255   7]
    [235  14 249  12 244 252   2   8 248 240]
    [254   8   2 254 244   4  11 247   4   9]
    [253  17  12   9 249 248  11   6 246 255]
    [  9 244  12 253 249   6 247 248   4   7]
    [253   5   4   0   6  14  13   7   0  13]
    [254   4   3 237 243   3 246 247  10 255]
    [251   7 245 250   7   7   3   0  10 248]]
   <NDArray 10x10 @cpu(0)>
   
   [0]
   <NDArray 1 @cpu(0)> 
   [82]
   <NDArray 1 @cpu(0)>
   110.9 11090
   
   [[  5  19   2  -2  -1  -6 -16  -5  12 -15]
    [  4  13  -6   9 -17   9  10  -9   7   3]
    [  8  14   2   0 -16  -3  15   5  -1   7]
    [-21  14  -7  12 -12  -4   2   8  -8 -16]
    [ -2   8   2  -2 -12   4  11  -9   4   9]
    [ -3  17  12   9  -7  -8  11   6 -10  -1]
    [  9 -12  12  -3  -7   6  -9  -8   4   7]
    [ -3   5   4   0   6  14  13   7   0  13]
    [ -2   4   3 -19 -13   3 -10  -9  10  -1]
    [ -5   7 -11  -6   7   7   3   0  10  -8]]
   <NDArray 10x10 @cpu(0)>
   
   [0]
   <NDArray 1 @cpu(0)> 
   [82]
   <NDArray 1 @cpu(0)>
   
   ```
   
   ## Minimum reproducible example
   ```py
   import mxnet as mx
   mx.random.seed(42)
   arr1 = mx.random.randn(10, 10)*10
   print(arr1)
   print(arr1.mean(), arr1.sum())
   
   mx.random.seed(42)
   arr2 = mx.random.randn(10, 10)*10
   arr2 = arr2.astype('uint8')
   print(arr2)
   print(arr2.mean(), arr2.sum())
   print(arr2.asnumpy().mean(), arr2.asnumpy().sum())  # this is the expected ouput.
   
   mx.random.seed(42)
   arr3 = mx.random.randn(10, 10)*10
   arr3 = arr3.astype('int32')
   print(arr3)
   print(arr3.mean(), arr3.sum())
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services