Running kf file from command line

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running kf file from command line

Desai Ankit
Hello Community, 

When I am trying to run weka  3.9.0 with following command then it generates exception shown bellow. 

  ~/Desktop  java -classpath ~/Data/weka-3-9-1/weka.jar:~/wekafiles/packages/distributedWekaSpark/distributedWekaSpark.jar:~/wekafiles/packages/distributedWekaBase/distributedWekaBase.jar weka.gui.beans.FlowRunner ./kfml/my.kf


[WekaPackageManager] Added a dependency between wekaDeeplearning4jCore and wekaDeeplearning4jCPULibs
java.io.StreamCorruptedException: invalid stream header: 7B0A0922
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
weka.gui.beans.FlowRunner.loadBinary(FlowRunner.java:235)
weka.gui.beans.FlowRunner.load(FlowRunner.java:216)
weka.gui.beans.FlowRunner.main(FlowRunner.java:525)

at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
at weka.gui.beans.FlowRunner.loadBinary(FlowRunner.java:235)
at weka.gui.beans.FlowRunner.load(FlowRunner.java:216)
at weka.gui.beans.FlowRunner.main(FlowRunner.java:525)


Please Help. 
--

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running kf file from command line

Mark Hall
If your flow file is a new json-based one then you are trying to run it using the old legacy knowledge flow FlowRunner tool. Furthermore, you do not need to manually add package jar files to your classpath as the package manager will load them for you.

Try:

java –classpath ~/Data/weka-3-9-1/weka.jar weka.Run .FlowRunner ./kfml/my.kf

If the flow file is an old binary serialized flow, then I'm not too sure what is causing the StreamCorruptedException. However, that format is no longer supported, and flows containing components from packages do not load (at least under 3.8.1/3.9.1 with the new package classloaders).

Cheers,
Mark.

On 10/05/17, 6:30 PM, "Desai Ankit" <[hidden email] on behalf of [hidden email]> wrote:

    Hello Community,
    When I am trying to run weka  3.9.0 with following command then it generates exception shown bellow.
   
      ~/Desktop  java -classpath ~/Data/weka-3-9-1/weka.jar:~/wekafiles/packages/distributedWekaSpark/distributedWekaSpark.jar:~/wekafiles/packages/distributedWekaBase/distributedWekaBase.jar weka.gui.beans.FlowRunner ./kfml/my.kf
   
   
    [WekaPackageManager] Added a dependency between wekaDeeplearning4jCore and wekaDeeplearning4jCPULibs
    java.io.StreamCorruptedException: invalid stream header: 7B0A0922
    java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
    java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
    weka.gui.beans.FlowRunner.loadBinary(FlowRunner.java:235)
    weka.gui.beans.FlowRunner.load(FlowRunner.java:216)
    weka.gui.beans.FlowRunner.main(FlowRunner.java:525)
   
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
    at weka.gui.beans.FlowRunner.loadBinary(FlowRunner.java:235)
    at weka.gui.beans.FlowRunner.load(FlowRunner.java:216)
    at weka.gui.beans.FlowRunner.main(FlowRunner.java:525)
   
   
    Please Help.
    --
    Ankit Desai
    http://ankitbdesai.blogspot.in/
   
   
   
   
   
   
    _______________________________________________
    Wekalist mailing list
    Send posts to: [hidden email]
    List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
    List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
   


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running kf file from command line

Desai Ankit
Mark, it worked magically for a demo. I shall try for a real data and on hadoop/spark cluster. Hopefully it will work flow-less. Thanks for immediate help. 

On Wed, May 10, 2017 at 2:45 PM, Mark Hall <[hidden email]> wrote:
If your flow file is a new json-based one then you are trying to run it using the old legacy knowledge flow FlowRunner tool. Furthermore, you do not need to manually add package jar files to your classpath as the package manager will load them for you.

Try:

java –classpath ~/Data/weka-3-9-1/weka.jar weka.Run .FlowRunner ./kfml/my.kf

If the flow file is an old binary serialized flow, then I'm not too sure what is causing the StreamCorruptedException. However, that format is no longer supported, and flows containing components from packages do not load (at least under 3.8.1/3.9.1 with the new package classloaders).

Cheers,
Mark.

On 10/05/17, 6:30 PM, "Desai Ankit" <[hidden email] on behalf of [hidden email]> wrote:

    Hello Community,
    When I am trying to run weka  3.9.0 with following command then it generates exception shown bellow.

      ~/Desktop  java -classpath ~/Data/weka-3-9-1/weka.jar:~/wekafiles/packages/distributedWekaSpark/distributedWekaSpark.jar:~/wekafiles/packages/distributedWekaBase/distributedWekaBase.jar weka.gui.beans.FlowRunner ./kfml/my.kf


    [WekaPackageManager] Added a dependency between wekaDeeplearning4jCore and wekaDeeplearning4jCPULibs
    java.io.StreamCorruptedException: invalid stream header: 7B0A0922
        java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
        java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
        weka.gui.beans.FlowRunner.loadBinary(FlowRunner.java:235)
        weka.gui.beans.FlowRunner.load(FlowRunner.java:216)
        weka.gui.beans.FlowRunner.main(FlowRunner.java:525)

        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
        at weka.gui.beans.FlowRunner.loadBinary(FlowRunner.java:235)
        at weka.gui.beans.FlowRunner.load(FlowRunner.java:216)
        at weka.gui.beans.FlowRunner.main(FlowRunner.java:525)


    Please Help.
    --
    Ankit Desai
    http://ankitbdesai.blogspot.in/






    _______________________________________________
    Wekalist mailing list
    Send posts to: [hidden email]
    List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
    List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



--
Ankit Desai

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running kf file from command line

Desai Ankit
Mark, 

Is it possible to load csv file explicitly from command line in ArffHeaderSparkJob? 

Thanks,
Ankit

On Wed, May 10, 2017 at 3:14 PM, Desai Ankit <[hidden email]> wrote:
Mark, it worked magically for a demo. I shall try for a real data and on hadoop/spark cluster. Hopefully it will work flow-less. Thanks for immediate help. 

On Wed, May 10, 2017 at 2:45 PM, Mark Hall <[hidden email]> wrote:
If your flow file is a new json-based one then you are trying to run it using the old legacy knowledge flow FlowRunner tool. Furthermore, you do not need to manually add package jar files to your classpath as the package manager will load them for you.

Try:

java –classpath ~/Data/weka-3-9-1/weka.jar weka.Run .FlowRunner ./kfml/my.kf

If the flow file is an old binary serialized flow, then I'm not too sure what is causing the StreamCorruptedException. However, that format is no longer supported, and flows containing components from packages do not load (at least under 3.8.1/3.9.1 with the new package classloaders).

Cheers,
Mark.

On 10/05/17, 6:30 PM, "Desai Ankit" <[hidden email] on behalf of [hidden email]> wrote:

    Hello Community,
    When I am trying to run weka  3.9.0 with following command then it generates exception shown bellow.

      ~/Desktop  java -classpath ~/Data/weka-3-9-1/weka.jar:~/wekafiles/packages/distributedWekaSpark/distributedWekaSpark.jar:~/wekafiles/packages/distributedWekaBase/distributedWekaBase.jar weka.gui.beans.FlowRunner ./kfml/my.kf


    [WekaPackageManager] Added a dependency between wekaDeeplearning4jCore and wekaDeeplearning4jCPULibs
    java.io.StreamCorruptedException: invalid stream header: 7B0A0922
        java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
        java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
        weka.gui.beans.FlowRunner.loadBinary(FlowRunner.java:235)
        weka.gui.beans.FlowRunner.load(FlowRunner.java:216)
        weka.gui.beans.FlowRunner.main(FlowRunner.java:525)

        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
        at weka.gui.beans.FlowRunner.loadBinary(FlowRunner.java:235)
        at weka.gui.beans.FlowRunner.load(FlowRunner.java:216)
        at weka.gui.beans.FlowRunner.main(FlowRunner.java:525)


    Please Help.
    --
    Ankit Desai
    http://ankitbdesai.blogspot.in/






    _______________________________________________
    Wekalist mailing list
    Send posts to: [hidden email]
    List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
    List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



--
Ankit Desai



--
Ankit Desai

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Loading...