opcode81 / ProbCog

A toolbox for statistical relational learning and reasoning.
GNU General Public License v3.0
101 stars 26 forks source link

blnlearn Doesn't create output files + issues with netEd (Cannot load 32-bit SWT libraries on 64-bit JVM) #15

Closed AnujGandhi123 closed 6 years ago

AnujGandhi123 commented 6 years ago

anuj:~/ProbCog-master/examples/grades$ blnlearn

starting learnABL...

command: learnABL -x "grades.xml" -b "grades.blog" -t "grades.blogdb" -ob "grades.learnt.blog" -ox "grades.learnt.xml" -d -i

Signatures: non-logical non-utility DifficultyLevel difficulty(Course) non-logical non-utility Boolean teaches(Professor,Course) non-logical non-utility Grade grade(Student,Course) non-logical non-utility Boolean advises(Professor,Student) non-logical non-utility Boolean takes(Student,Course) non-logical non-utility Boolean teacherOfLikesAdvisorOf(Course,Student) non-logical non-utility Boolean likes(Professor,Professor) non-logical non-utility IntelligenceLevel intelligence(Student) Reading data... Searching for 'grades.blogdb' in '.'... reading /home/anuj/ProbCog-master/examples/grades/./grades.blogdb... Learning domains... intelligence(s) difficulty(c) takes(s,c) teaches(p1,c) advises(p2,s) likes(p1,p2) OR:teacherOfLikesAdvisorOf(c,s)|p1,p2 grade(s,c) intelligence(s) difficulty(c) takes(s,c) teaches(p1,c) advises(p2,s) likes(p1,p2) OR:teacherOfLikesAdvisorOf(c,s)|p1,p2 grade(s,c) Domains: difficulty: DifficultyLevel teaches: Boolean grade: Grade advises: Boolean takes: Boolean teacherOfLikesAdvisorOf: Boolean likes: Boolean intelligence: IntelligenceLevel Learning parameters... database 1/1 intelligence(s) probcog.exception.ProbCogException: Missing database value of intelligence(John) - cannot apply closed-world assumption because domain is not boolean: IntelligenceLevel at probcog.srl.Database.getVariableValue(Database.java:74) at probcog.srl.Database.getVariableValue(Database.java:37) at probcog.srl.directed.learning.CPTLearner.countVariableR(CPTLearner.java:297) at probcog.srl.directed.learning.CPTLearner.processGrounding(CPTLearner.java:227) at probcog.srl.directed.learning.CPTLearner.processAllGroundings(CPTLearner.java:435) at probcog.srl.directed.learning.CPTLearner.processAllGroundings(CPTLearner.java:451) at probcog.srl.directed.learning.CPTLearner.learnTyped(CPTLearner.java:406) at probcog.srl.directed.learning.BLNLearner.learn(BLNLearner.java:215) at probcog.srl.directed.learning.BLNLearner.main(BLNLearner.java:266)

total execution time: 1.544 seconds

at the end of running the example, i expect two output files : 1.)grades.learnt.blog and 2.)grades.learnt.xml

However, no file is generated in the directory.

opcode81 commented 6 years ago

Did you see the exception in the output you posted? The file "grades.blogdb" which comes with ProbCog is meant to serve as an evidence database; it cannot be used as a training database.

AnujGandhi123 commented 6 years ago

Thank you !!!!

Also, I'm using64 bit ubuntu...

and i get this message while trying to open netEd

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source) at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source) at org.eclipse.swt.internal.C.(Unknown Source) at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source) at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source) at org.eclipse.swt.widgets.Display.(Unknown Source) at edu.ksu.cis.bnj.gui.GUIWindow.(GUIWindow.java:153) at probcog.bayesnets.core.BeliefNetworkEx.show(BeliefNetworkEx.java:689) at probcog.BNJ.main(BNJ.java:54).

Can you tell me how to update SWT to 64bit ? or direct me to a website?

opcode81 commented 6 years ago

This has now been fixed with commit 5d8c7d5 (the 32 and 64 bit SWT artifacts were mixed up for Linux). Please re-run configurePOM and it should work fine.

AnujGandhi123 commented 6 years ago

i ran Python2 configurePOM.py and it didn't change the problem..should i reinstall everything again?

opcode81 commented 6 years ago

The steps to make it work are:

  1. Pull the latest changes
  2. Run configurePOM.py
  3. Run make_apps.py
AnujGandhi123 commented 6 years ago

Thank you..!

Also, give me sometime. I'll get back to you on the other thread as soon as possible. I need to talk to my advisor before I can reply. He's out of town and will be back sometime next week.

Thanks for all the help that you've been providing. I really appreciate it.

hschulth commented 5 years ago

I seem to have a similar problem, although I am using the most recent version. While mlnquery, blnquery, and blnlearn all start without problem, netEd gives me the following error:

java.lang.NullPointerException at org.eclipse.swt.widgets.TabFolder.gtk_switch_page(Unknown Source) at org.eclipse.swt.widgets.Widget.windowProc(Unknown Source) at org.eclipse.swt.widgets.Display.windowProc(Unknown Source) at org.eclipse.swt.internal.gtk.OS._gtk_widget_show(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_widget_show(Unknown Source) at org.eclipse.swt.widgets.TabFolder.createItem(Unknown Source) at org.eclipse.swt.widgets.TabItem.createWidget(Unknown Source) at org.eclipse.swt.widgets.TabItem.(Unknown Source) at edu.ksu.cis.bnj.gui.GUIWindow.run(GUIWindow.java:902) at edu.ksu.cis.bnj.gui.GUIThread.run(GUIThread.java:66) at org.eclipse.swt.widgets.Synchronizer.syncExec(Unknown Source) at org.eclipse.swt.widgets.Display.syncExec(Unknown Source) at edu.ksu.cis.bnj.gui.GUIWindow.open(GUIWindow.java:659) at edu.ksu.cis.bnj.gui.GUIWindow.open(GUIWindow.java:665) at probcog.bayesnets.core.BeliefNetworkEx.show(BeliefNetworkEx.java:691) at probcog.BNJ.main(BNJ.java:54)

I am using Ubuntu 18.04 with openjdk 10.0.2. I am not even sure what the exact problem is ...

How can I fix this?

Thanks!

opcode81 commented 5 years ago

@hschulth, it looks like an SWT problem. Did you adapt the POM to your OS by running configurePOM.py? Maybe that's the issue.

hschulth commented 5 years ago

I ran configurePOM.py.

Not sure this is related, but in the meantime I discovered that executing genDB also gives rise to an error: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.python.google.common.base.internal.Finalizer (file:/home/schulth/.m2/repository/org/python/jython/2.5.3/jython-2.5.3.jar) to field java.lang.Thread.inheritableThreadLocals WARNING: Please consider reporting this to the maintainers of org.python.google.common.base.internal.Finalizer WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Exception in thread "main" Traceback (most recent call last): File "gen.py", line 2, in from datagen import * File "/home/schulth/ProbCog-master/src/main/python/datagen.py", line 12, in import random ImportError: No module named random

Using the random module from the Python prompt is no problem though.

Any ideas what may be going on?

Thanks!