CoinCheung opened a new issue #9978: Error with random generator
URL: https://github.com/apache/incubator-mxnet/issues/9978
 
 
   
   
   ## Description
   Once I use DataLoader, the nd.random seed will be fixed.
   
   ## Environment info (Required)
   
   ```
   ----------Python Info----------                                              
                                                                                
                                 
   Version      : 3.6.4                                                         
                                                                                
   
   Compiler     : GCC 7.2.1 20171224                                            
                                                                                
                                 
   Build        : ('default', 'Jan  5 2018 02:35:40')                           
                                                                                
                                 
   Arch         : ('64bit', '')                                                 
                                                                                
                                 
   ------------Pip Info-----------                                              
                                                                                
                                 
   Version      : 9.0.1                                                         
                                                                                
   
   Directory    : /usr/lib/python3.6/site-packages/pip                          
                                                                                
                                 
   ----------MXNet Info-----------                                              
                                                                                
                                 
   Version      : 1.1.0                                                         
                                                                                
   
   Directory    : /home/coin/.local/lib/python3.6/site-packages/mxnet           
                                                                                
                                 
   Commit Hash   : 07a83a0325a3d782513a04f47d711710972cb144                     
                                                                                
                                 
   ----------System Info----------                                              
                                                                                
                                 
   Platform     : Linux-4.14.15-1-ARCH-x86_64-with-arch                         
                                                                                
                                 
   system       : Linux                                                         
                                                                                
   
   node         : Arch-R720                                                     
                                                                                
                   
   release      : 4.14.15-1-ARCH                                                
                                                                                
                                 
   version      : #1 SMP PREEMPT Tue Jan 23 21:49:25 UTC 2018                   
                                                                                
                                 
   ----------Hardware Info----------
   machine      : x86_64
   processor    : 
   Architecture:        x86_64
   CPU op-mode(s):      32-bit, 64-bit
   Byte Order:          Little Endian
   CPU(s):              4
   On-line CPU(s) list: 0-3
   Thread(s) per core:  1
   Core(s) per socket:  4
   Socket(s):           1
   NUMA node(s):        1
   Vendor ID:           GenuineIntel
   CPU family:          6
   Model:               158
   Model name:          Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
   Stepping:            9
   CPU MHz:             3195.292
   CPU max MHz:         3500.0000
   CPU min MHz:         800.0000
   BogoMIPS:            4993.00
   Virtualization:      VT-x
   L1d cache:           32K
   L1i cache:           32K
   L2 cache:            256K
   L3 cache:            6144K
   NUMA node0 CPU(s):   0-3
   Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge 
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx 
pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl 
xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 
monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 
x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 
3dnowprefetch cpuid_fault invpcid_single pti retpoline rsb_ctxsw tpr_shadow 
vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid 
mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm 
ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp
   ----------Network Test----------
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0051 
sec, LOAD: 1.8638 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0090 sec, LOAD: 
5.4130 sec.
   Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0096 sec, LOAD: 
8.2085 sec.
   Timing for FashionMNIST: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz,
 DNS: 5.2088 sec, LOAD: 11.3016 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0071 sec, LOAD: 
1.0104 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0096 sec, 
LOAD: 0.6771 sec.
   ```
   
   Package used (Python/R/Scala/Julia):
   (I'm using python)
   
   ## Minimum reproducible example
   ```
       cifar10_train = mx.gluon.data.vision.datasets.CIFAR10(
           root='~/.mxnet/datasets/cifar10/',
           train=True,
           transform=None
       )
       train_data = mx.gluon.data.DataLoader(
           cifar10_train,
           batch_size=1,
           shuffle=True,
           last_batch ='rollover'
       )
   
       for batch, label in train_data:
           print(batch[0][0][0])
   
           noise = mx.nd.random.normal(0,1,shape=(3,32,32),dtype=np.float32)
           print(noise[0][0][0])
           break
   
   ```
   ## Steps to reproduce
   1. paste the code to a python file random_error.py
   2. run it with python random_error.py for several times
   3. each time the batch[0][0][0] will be different which shows that the batch 
is randomly chosen, while the noise[0][0][0] is always the same value, which I 
believe is seed-fixed.
   
   ## What have you tried to solve it?
   
   1. 
   2.
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to