Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuring jidt with jpype for info theoretic measures #3

Open
x75 opened this issue Apr 5, 2019 · 10 comments
Open

configuring jidt with jpype for info theoretic measures #3

x75 opened this issue Apr 5, 2019 · 10 comments

Comments

@x75
Copy link
Owner

x75 commented Apr 5, 2019

jpype fails to import because infodynamics.jar is not found

depending code may fail breaking the script

@x75
Copy link
Owner Author

x75 commented Apr 5, 2019

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

@NevilleKitala
Copy link

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
Copy link
Owner Author

x75 commented Apr 8, 2019

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

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

@NevilleKitala
Copy link

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
Copy link
Owner Author

x75 commented Apr 8, 2019

where do run the script from, pwd?

@x75
Copy link
Owner Author

x75 commented Apr 8, 2019

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
Copy link
Owner Author

x75 commented Apr 8, 2019

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 😅

@x75
Copy link
Owner Author

x75 commented Apr 8, 2019

referring back to x75/smp_sphero#2

@NevilleKitala
Copy link

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

@x75
Copy link
Owner Author

x75 commented Apr 8, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants