BIDData / BIDMach

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

converting datasets error #16

Closed maydaygmail closed 9 years ago

maydaygmail commented 9 years ago

The benchmarks of this project are amazing! I would like to use it. cd scripts and ./getdata.sh, datasets can get successfully, but cant convert. There are the errors: /xxxx/BIDMach/scripts/../bin/tparse.exe: No such file or directory /tmp/scalacmd9053744229355367880.scala:2: error: not found: value BIDMat

Before download and convert datasets, I run ./sbt package and ./bidmach, both look right. Thank you!

jcanny commented 9 years ago

We need some more information. I assume you downloaded one of the releases. Which one? What platform are you running on?

maydaygmail commented 9 years ago

Thanks! I downloaded source codes from the github, and copy libs from http://bid2.berkeley.edu/bid-data-project/download/. Compile it on CentOS. In src/main/C/newparse/, compile tparse.exe and trec.exe. When I exec the getrcv1.sh, all commands were success except ${BIDMACH_SCRIPTS}/../bidmach "-e" "BIDMach.RCV1.prepare(\"${RCV1}/tokenized/\")", there are error msg: /tmp/scalacmd6598159249571303635.scala:1: error: not found: value BIDMat import BIDMat.{CMat,CSMat,DMat,Dict,IDict,Image,FMat,FND,GMat,GIMat,GSMat,HMat,IMat,Mat,SMat,SBMat,SDMat}

svanschalkwyk commented 9 years ago

Copy the BidMat.jar to the root folder or BIDMach. Make sure you have the latest BIDMat release as well. S

On Mon, Nov 17, 2014 at 8:28 PM, maydaygmail notifications@github.com wrote:

Thanks! I downloaded source codes from the github, and copy libs from http://bid2.berkeley.edu/bid-data-project/download/. Compile it on CentOS. In src/main/C/newparse/, compile tparse.exe and trec.exe. When I exec the getrcv1.sh, all commands were success except ${BIDMACH_SCRIPTS}/../bidmach "-e" "BIDMach.RCV1.prepare(\"${RCV1}/tokenized/\")", there are error msg: /tmp/scalacmd6598159249571303635.scala:1: error: not found: value BIDMat import BIDMat.{CMat,CSMat,DMat,Dict,IDict,Image,FMat,FND,GMat,GIMat,GSMat,HMat,IMat,Mat,SMat,SBMat,SDMat}

— Reply to this email directly or view it on GitHub https://github.com/BIDData/BIDMach/issues/16#issuecomment-63413179.


Remcam LLC http://remcam.net http://remcam.net Google Voice & SMS: +1 312 281 8982 (rings all lines) Skype: svanschalkwyk

http://linkedin.com/in/vanschalkwyk

maydaygmail commented 9 years ago

yes, I had made a softlink to BidMat.jar in the foot folder.....I am a beginner to scala

maydaygmail commented 9 years ago

The problem has been solved.

  1. ./bidmach then enter into a console
  2. typing BIDMach.RCV1.prepare("/xxxx/BIDMach/data/rcv1/tokenized/")

the command "${BIDMACH_ROOT}/scripts/scala/scala -nobootcp -toolcp "${ALL_LIBS}" -Yrepl-sync -i ${LIBDIR}/bidmach_init.scala "$@"" in bidmach.sh has a option "-i" , which means:Requests that a file be pre-loaded. It is only meaningful for interactive shells.

and the command ${BIDMACH_SCRIPTS}/../bidmach "-e" "BIDMach.RCV1.prepare(\"${RCV1}/tokenized/\")" has an option "-e", which means:Requests that its argument be executed as Scala code.

So "-i" become useless because of "-e"

I have another question: if I want to exec a program, for example, a LR learner. and I dont want to exec it in a console, I would like it exec like this: I write scala instructions in a *.scala file, then compile it ,and exec it as a Executable File. How can I do it? Thanks!

svanschalkwyk commented 9 years ago

Use scala.sys.process You can google it S


Remcam LLC http://remcam.net Google Voice & SMS: +1 312 281 8982 (rings all lines) Skype: svanschalkwyk

http://linkedin.com/in/vanschalkwyk

On Nov 17, 2014 10:17 PM, "maydaygmail" notifications@github.com wrote:

The problem has been solved.

  1. ./bidmach then enter into a console
  2. typing BIDMach.RCV1.prepare("/xxxx/BIDMach/data/rcv1/tokenized/")

I have another question: if I want to exec a program, for example, a LR learner. and I dont want to exec it in a console, I would like it exec like this: I write scala instructions in a *.scala file, then compile it ,and exec it as a Executable File. How can I do it? Thanks!

— Reply to this email directly or view it on GitHub https://github.com/BIDData/BIDMach/issues/16#issuecomment-63420558.

jcanny commented 9 years ago

Most of the jars should be in BIDMach/lib. e.g. BIDMat.jar should be there. The root BIDMach directory should contain a copy of BIDMach.jar only.

You're right that "-e" is now pre-empting "-i" which is breaking the data fetching scripts. It used to work, and the correct behavior according to the docs should be to load startup scripts with -i before starting the interpreter, at which point it should eval the "-e" options.

If -i is only for interactive scripts (this is a change), then I'll have to do the BIDMach imports as part of the command. The problem is that the :load command probably wont be there. Arghh, this used to be simple and clean.

jcanny commented 9 years ago

Actually, its not that "-e" is interfering with "-i", since it doesnt need the "-i" script to run a class.

"-e" is breaking the classpath. That shouldnt happen...

jcanny commented 9 years ago

OK its a classpath problem. The solution is to edit the bidmach/bidmat main script and replace the penultimate line

${BIDMACH_ROOT}/scripts/scala/scala -nobootcp -toolcp "${ALL_LIBS}" -Yrepl-sync ... with ${BIDMACH_ROOT}/scripts/scala/scala -nobootcp -toolcp "${ALL_LIBS}" -cp "${ALL_LIBS}" -Yrepl-sync...

jcanny commented 9 years ago

I'll upload new version tonight as a minor release. We're due to release a Scala 2.11 version anyway.

maydaygmail commented 9 years ago

modified script as jcanny, it works! Thank you!