x75 / smp_base

Sensorimotor primitives basic library
MIT License
6 stars 4 forks source link

configuring jidt with jpype for info theoretic measures #3

Open x75 opened 5 years ago

x75 commented 5 years ago

jpype fails to import because infodynamics.jar is not found

depending code may fail breaking the script

x75 commented 5 years ago

check smp_base/README and make sure you have installed, downloaded and configured all the components

NevilleKitala commented 5 years ago

I have followed the installation instructions you have prescribed for smp_base. With my file structure as follows:

smp_base: -.git -doc -infodynamics: --infodynamics.jar -smp_base: --config.py -vendors: --rlspy

I am still getting an error about infodynamics not being found. This might be an issue with how i have written the config.py file:

Imported RLSPY ./vendor/rlspy/ Couldn't import emd from emd with No module named emd, make sure emd is installed. Traceback (most recent call last): File "src/smp_sphero/sphero_res_learner_1D.py", line 15, in from smp_base.models_learners import learnerEH File "/home/neville/ROS/src/smp_base/smp_base/models_learners.py", line 34, in from smp_base.measures_infth import init_jpype, dec_compute_infth_soft File "/home/neville/ROS/src/smp_base/smp_base/measures_infth.py", line 76, in init_jpype() File "/home/neville/ROS/src/smp_base/smp_base/measures_infth.py", line 60, in init_jpype assert os.path.exists(jarloc), "Jar file %s doesn't exist" % jarloc AssertionError: Jar file ./infodynamics/infodynamics.jar/ doesn't exist

the config file that I created looked like this:

RLOC='./infodynamics/infodynamics.jar' RLSPY='./vendor/rlspy/'

Any advice would be appreciated.

x75 commented 5 years ago

try to set absolute path in config.py, e.g.

JARLOC=/home/neville/ROS/src/smp_base/infodynamics/infodynamics.jar

NevilleKitala commented 5 years ago

Thank you that seems to have cleared that error up. The program now runs upto openning the cfg filed in sphero_res_learner_1D. THe issue is this:

Imported RLSPY /home/neville/ROS/src/smp_base/vendor/rlspy/ Couldn't import emd from emd with No module named emd, make sure emd is installed. infth.init_jpype: Set jidt jar location to /home/neville/ROS/src/smp_base/infodynamics/infodynamics.jar infth.init_jpype: Set jidt jvmpath to /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so Starting JVM infth.init_jpype: Set jidt jar location to /home/neville/ROS/src/smp_base/infodynamics/infodynamics.jar infth.init_jpype: Set jidt jvmpath to /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so Attaching JVM Datadir doesn't exist, try mkdir 'sphero_res_learner_1D'

/home/neville/ROS/src/smp_base/smp_base/smp_thread.py:97: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information. self.pub["learn_y"] = rospy.Publisher("/learner/y", reservoir) opening sphero_res_learner_1D/default.cfg Traceback (most recent call last): File "src/smp_sphero/sphero_res_learner_1D.py", line 413, in main(args) File "src/smp_sphero/sphero_res_learner_1D.py", line 348, in main s = SpheroResLearner1D(args) File "src/smp_sphero/sphero_res_learner_1D.py", line 31, in init learnerEH.init(self, args) File "/home/neville/ROS/src/smp_base/smp_base/models_learners.py", line 951, in init self.cfg.cfgget() File "/home/neville/ROS/src/smp_base/smp_base/models_learners.py", line 600, in cfgget self.mode = self.cfg.get("learner", "mode") File "/usr/lib/python2.7/dist-packages/backports/configparser/init.py", line 792, in get d = self._unify_values(section, vars) File "/usr/lib/python2.7/dist-packages/backports/configparser/init.py", line 1162, in _unify_values raise NoSectionError(section) backports.configparser.NoSectionError: No section: 'learner'. I am sorry for all this inconvenience.

x75 commented 5 years ago

where do run the script from, pwd?

x75 commented 5 years ago

you'll need to be in the smp_sphero/ directory. for each of the two 1D and 2D scripts there's a directory with the same name, that contains the config files

x75 commented 5 years ago

the parser says: nosectionerror because the file isn't found.

sorry as well but happy to try and fix as long as you can maintain motivation :sweat_smile:

x75 commented 5 years ago

referring back to https://github.com/x75/smp_sphero/issues/2

NevilleKitala commented 5 years ago

I have it running at the moment. Thank you for your time. I will keep you posted on my progress!

x75 commented 5 years ago

wow, great. please do post, quite curious.

need to merge your feedback into install docs. hopefully more significant updates in smp installation, docs and code soon.

also, smp_sphero is obsolete / legacy code, planning to recreate the functionality in a more general way within smp project.