You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Alex Luya <al...@gmail.com> on 2010/09/05 12:00:49 UTC

Error: org.apache.hadoop.io.IntWritable cannot be cast to org.apache.mahout.math.VectorWritable

Hello 
       I am running the example in <<mahout in action>> under hadoop 0.20,2+mahout 0.3,steps are :
1,download  Reuters 21578 news collection
2, run:mvn -e -q exec:java -Dexec.mainClass="org.apache.lucene.benchmark.utils.ExtractReuters" -Dexec.args="reuters/ reuters-extracted/"
3,run:mahout seqdirectory -c UTF-8 -i examples/reuters-extracted/ -o reuters-seqfiles
4,last run:mahout kmeans -i reuters-vectors -c reuters-initial-clusters -o reuters-kmeans-clusters -m 
org.apache.mahout.common.distance.SquaredEuclideanDistanceMeasure -r 1 -d 1.0 -k 20 -x 10



got errors:
------------------------------------------------------------------------------------------------------------------------------------------------------------
running on hadoop, using HADOOP_HOME=/usr/local/hadoop/hadoop-0.20.2+320 and HADOOP_CONF_DIR=/usr/local/hadoop/hadoop-0.20.2+320/conf
10/09/05 17:53:22 INFO util.NativeCodeLoader: Loaded the native-hadoop library
10/09/05 17:53:22 INFO zlib.ZlibFactory: Successfully loaded & initialized native-zlib library
10/09/05 17:53:22 INFO compress.CodecPool: Got brand-new compressor
10/09/05 17:53:22 ERROR driver.MahoutDriver: MahoutDriver failed with args: [-i, reuters-vectors, -c, reuters-initial-clusters, -o, reuters-kmeans-
clusters, -m, org.apache.mahout.common.distance.SquaredEuclideanDistanceMeasure, -r, 1, -d, 1.0, -k, 20, -x, 10, null]
org.apache.hadoop.io.IntWritable cannot be cast to org.apache.mahout.math.VectorWritable
Exception in thread "main" java.lang.ClassCastException: org.apache.hadoop.io.IntWritable cannot be cast to org.apache.mahout.math.VectorWritable
        at org.apache.mahout.clustering.kmeans.RandomSeedGenerator.buildRandom(RandomSeedGenerator.java:92)
        at org.apache.mahout.clustering.kmeans.KMeansDriver.main(KMeansDriver.java:164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
        at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
        at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:172)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
---------------------------------------------------------------------------------------------------------------------

Any suggestion to solve this problem?