BIDData / BIDMach

CPU and GPU-accelerated Machine Learning Library
BSD 3-Clause "New" or "Revised" License
913 stars 168 forks source link

Cannot find function ~ for FMat in CPU mode. #134

Open qihqi opened 7 years ago

qihqi commented 7 years ago

Running ./bidmach script/testPowerNet35.scc gives the following error: han@helene ~/capstone/BIDMach $ ./bidmach scripts/testPowerNet35.ssc Loading /home/han/capstone/BIDMach/lib/bidmachinit.scala... import BIDMat.{CMat, CSMat, DMat, Dict, FMat, FND, GMat, GDMat, GIMat, GLMat, GSMat, GSDMat, GND, HMat, IDict, Image, IMat, LMat, Mat, SMat, SBMat, SDMat, TMat} import BIDMat.MatFunctions. import BIDMat.SciFunctions. import BIDMat.Solvers. import BIDMat.Plotting._ import BIDMach.Learner import BIDMach.models.{Click, FM, GLM, KMeans, KMeansw, LDA, LDAgibbs, Model, NMF, SFA, RandomForest, SVD} import BIDMach.networks.Net import BIDMach.datasources.{DataSource, MatSource, FileSource, SFileSource} import BIDMach.datasinks.{DataSink, MatSink} import BIDMach.mixins.{CosineSim, Perplexity, Top, L1Regularizer, L2Regularizer} import BIDMach.updaters.{ADAGrad, Batch, BatchNorm, Grad, IncMult, IncNorm, Telescoping} import BIDMach.causal.IPTW NVIDIA: no NVIDIA devices found 0 CUDA devices found

Loading scripts/testPowerNet35.ssc... Switched off result printing. Option Name Type Value =========== ==== ===== addConstFeat boolean false aopts Opts BIDMach.networks.Net... autoReset boolean false batchSize int 100 checkPointFile String null checkPointInterval float 0.0 clipByValue float -1.0 cumScore int 0 debug int 0 debugMem boolean false dim int 256 dmask Mat null doAllReduce boolean false dorows boolean false doubleScore boolean false doVariance boolean false dropout float 0.5 eltsPerSample int 500 epsilon float 1.0E-5 evalStep int 11 featThreshold Mat null featType int 1 fnames List List(, <f... hasBias boolean false initsumsq float 1.0E-5 langevin float 0.0 links IMat 1 localDir String
logDataSink DataSink null logFuncs Function2[] null lookahead int 0 lrate FMat 0.010000 mask FMat null max_grad_norm float -1.0 mixinInterval int 1 momentum FMat null nend int 1 nesterov FMat null nmodelmats int 0 nodeset NodeSet BIDMach.networks.lay... npasses int 4 nstart int 0 nweight float 1.0E-4 nzPerColumn int 0 order int 0 pexp FMat 0.50000 policies Function2[] null predict boolean false pstep float 0.001 putBack int -1 r1nmats int 1 reg1weight FMat 1.0000e-07 resFile String null sample float 1.0 sampleFiles float 1.0 sizeMargin float 3.0 startBlock int 8000 targetNorm float 1.0 targmap Mat null texp FMat 0.30000 throwMissing boolean false tmatShape Function2 null traceFileSource int 0 updateAll boolean false useCache boolean true useDouble boolean false useGPU boolean true vexp FMat 0.50000 waitsteps int 3 withInteractions boolean false 0.2 200,120,80,50,1 java.lang.RuntimeException: CUDA alloc failed unknown error at BIDMat.GMat$.apply(GMat.scala:2084) at BIDMat.GMat$.zeros(GMat.scala:2048) at BIDMat.MatFunctions$.gzeros(MatFunctions.scala:1342) ... 54 elided java.lang.RuntimeException: mismatched types for operator ~ at BIDMat.FMat.$tilde(FMat.scala:1531) at BIDMach.networks.layers.LinLayer.forward(LinLayer.scala:59) at BIDMach.networks.Net.evalbatch(Net.scala:150) at BIDMach.networks.Net.init(Net.scala:64) at BIDMach.Learner.init(Learner.scala:62) at BIDMach.Learner.firstPass(Learner.scala:93) at BIDMach.Learner.retrain(Learner.scala:82) at BIDMach.Learner.train(Learner.scala:71) ... 54 elided java.lang.NullPointerException ... 54 elided java.lang.RuntimeException: mismatched types for operator ~ at BIDMat.FMat.$tilde(FMat.scala:1531) at BIDMach.networks.layers.LinLayer.forward(LinLayer.scala:59) at BIDMach.networks.Net.evalbatch(Net.scala:150) at BIDMach.networks.Net.init(Net.scala:64) at BIDMach.Learner.predict(Learner.scala:200) ... 54 elided java.lang.NullPointerException ... 54 elided

:39: error: not found: value preds val ll = DMat(ln(preds *@ testlabels + (1-preds) *@ (1-testlabels))) ^ :39: error: not found: value preds val rc = roc(preds, testlabels, 1-testlabels, 1000); ^ Switched on result printing. :37: error: not found: value ll (mean(ll), mean(rc)) ^ :37: error: not found: value rc (mean(ll), mean(rc)) ^ Welcome to Scala version 2.11.2 (OpenJDK 64-Bit Server VM, Java 1.8.0_91). Type in expressions to have them evaluated. Type :help for more information. scala> Tested on linux (Ubuntu) han@helene ~ $ uname -a Linux helene 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Tested with code: commit ac1a9d5c2ced822dd346081c3f96a25ebc13777e Author: jcanny jfc@cs.berkeley.edu Date: Sun Oct 16 00:12:19 2016 -0700 ``` mavenized bidmach script for Windows ```
actang commented 7 years ago

I have seen the same error message when running TestPowernNet.scc on my Mac OS.

In the TestPowerNet file, I added

setGPU(0)
opts.useGPU = false

since I don't have GPU installed on my laptop.

System Info:

>> uname -a
Darwin Allens-MacBook-Pro.local 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64

>> scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL

>> java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)