haifengl / smile

Statistical Machine Intelligence & Learning Engine
https://haifengl.github.io
Other
5.99k stars 1.12k forks source link

Getting NPE, AIOOBE when execute Nearest Neighbor Demo #687

Closed RobbiNespu closed 2 years ago

RobbiNespu commented 3 years ago

Describe the bug Got NPE when start NearestNeighborDemo

Generating dataset...
[Thread-0] INFO smile.math.MathEx - Set RNG seed 342317953 for thread Thread-0
Building searching data structure...
Perform 100 searches...
The recall of LSH is 90.0%
Exception in thread "Thread-0" java.lang.NullPointerException
    at smile.demo.neighbor.NearestNeighborDemo.run(NearestNeighborDemo.java:199)
    at java.base/java.lang.Thread.run(Thread.java:829)
Generating dataset...
[Thread-1] INFO smile.math.MathEx - Set RNG seed 521642753 for thread Thread-1
Building searching data structure...
Perform 1000 searches...
The recall of LSH is 96.8%
Exception in thread "Thread-1" java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
    at smile.plot.swing.Canvas.setAxisLabels(Canvas.java:309)
    at smile.demo.neighbor.KNNDemo.run(KNNDemo.java:242)
    at java.base/java.lang.Thread.run(Thread.java:829)
Generating dataset...
[Thread-2] INFO smile.math.MathEx - Set RNG seed 72070657 for thread Thread-2
Building searching data structure...
Perform 1000 searches...
Exception in thread "Thread-2" java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
    at smile.plot.swing.Canvas.setAxisLabels(Canvas.java:309)
    at smile.demo.neighbor.RNNSearchDemo.run(RNNSearchDemo.java:212)
    at java.base/java.lang.Thread.run(Thread.java:829)

Expected behavior No NPE and demo working

Additional context

robbi@debian: pts/2: /home/robbi/Documents/workplace/machine_learning/smile-2.6.0 
└─ $ inxi -S
System:    Host: debian Kernel: 5.10.0-8-amd64 x86_64 bits: 64 Desktop: KDE Plasma 5.20.5 
           Distro: Debian GNU/Linux 11 (bullseye) 

robbi@debian: pts/2: /home/robbi/Documents/workplace/machine_learning/smile-2.6.0 
└─ $ java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-post-Debian-1)
OpenJDK 64-Bit Server VM (build 11.0.11+9-post-Debian-1, mixed mode, sharing)

robbi@debian: pts/1: /home/robbi/Documents/workplace/machine_learning/smile-2.6.0 
└─ $ ./bin/smile 

                                                       ..::''''::..
                                                     .;''        ``;.
     ....                                           ::    ::  ::    ::
   ,;' .;:                ()  ..:                  ::     ::  ::     ::
   ::.      ..:,:;.,:;.    .   ::   .::::.         :: .:' ::  :: `:. ::
    '''::,   ::  ::  ::  `::   ::  ;:   .::        ::  :          :  ::
  ,:';  ::;  ::  ::  ::   ::   ::  ::,::''.         :: `:.      .:' ::
  `:,,,,;;' ,;; ,;;, ;;, ,;;, ,;;, `:,,,,:'          `;..``::::''..;'
                                                       ``::,,,,::''

  Welcome to Smile Shell! Type ":quit<RETURN>" to leave the Smile Shell.
  Version 2.6.0, Scala 2.13.4, SBT 1.4.2 built at 2020-12-05 12:04:02.534-0500
===============================================================================

smile> demo
RobbiNespu commented 3 years ago

I checked the source code on this repo. I unable to find the demo package module

haifengl commented 3 years ago

Demo module had been removed.