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 2017/11/15 17:08:33 UTC
[GitHub] analog-cbarber opened a new issue #8668: Precision error setting NDArray from np.float32 scalar
analog-cbarber opened a new issue #8668: Precision error setting NDArray from np.float32 scalar
URL: https://github.com/apache/incubator-mxnet/issues/8668
## Description
There is a precision error when assigning to a float32 NDArray from a numpy float32 scalar.
This appears to be a recently introduced bug.
## Environment info (Required)
```
----------Python Info----------
Version : 3.6.0
Compiler : GCC 4.2.1 (Apple Inc. build 5666) (dot 3)
Build : ('v3.6.0:41df79263a11', 'Dec 22 2016 17:23:13')
Arch : ('64bit', '')
------------Pip Info-----------
Version : 9.0.1
Directory : /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip
----------MXNet Info-----------
Version : 0.12.1
Directory : /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mxnet
Commit Hash : 710bf4e640f786805bd1ba76c4fb41e2e91f5917
----------System Info----------
Platform : Darwin-16.7.0-x86_64-i386-64bit
system : Darwin
node : cbarber-l02.local
release : 16.7.0
version : Darwin Kernel Version 16.7.0: Wed Oct 4 00:17:00 PDT 2017; root:xnu-3789.71.6~1/RELEASE_X86_64
----------Hardware Info----------
machine : x86_64
processor : i386
b'machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT RDTSCP TSCI'
b'machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 BMI2 INVPCID FPU_CSDS'
b'machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C'
b'machdep.cpu.brand_string: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz'
----------Network Test----------
Setting timeout: 10
Error open MXNet: https://github.com/apache/incubator-mxnet, <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>, DNS finished in 0.015892982482910156 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0671 sec, LOAD: 0.2588 sec.
Error open Gluon Tutorial(cn): https://zh.gluon.ai, <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>, DNS finished in 0.20620489120483398 sec.
Error open FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>, DNS finished in 0.07077932357788086 sec.
Error open PYPI: https://pypi.python.org/pypi/pip, <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>, DNS finished in 0.0006160736083984375 sec.
Error open Conda: https://repo.continuum.io/pkgs/free/, <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>, DNS finished in 0.05104780197143555 sec.
```
Package used (Python/R/Scala/Julia):
Python 3.6.0
## Build info (Required if built from source)
Fails with 0.12.1b20171115 and 0.12.1b20171114 builds but not with 0.12.1b20171113
## Error Message:
(Paste the complete error message, including stack trace.)
## Minimum reproducible example
```
import numpy as np
from mxnet import nd
a = np.array([47.844944], dtype=np.float32)
b = nd.zeros(1, dtype=np.float32)
b[0] = a
assert b[0].asnumpy() == a
b[0] = a[0]
assert b[0].asnumpy() == a, "%f != %f" % (b[0].asnumpy(),a[0])
```
## Steps to reproduce
Run the above script with assertions enabled. It fails with:
```
AssertionError: 47.844898 != 47.844944
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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