bio-ontology-research-group / mowl

mOWL: Machine Learning library with Ontologies
BSD 3-Clause "New" or "Revised" License
55 stars 4 forks source link

issues with installation #54

Closed chestnzu closed 1 year ago

chestnzu commented 1 year ago

Hi there: I meet some issues with the package installation. Following the documentations I install everything that was mentioned in https://mowl.readthedocs.io/en/latest/install/index.html. When I tried to run the embedding methods provided at this page 'https://mowl.readthedocs.io/en/latest/graphs/kge.html' I got this error. image

I tried to install from pypi and build from source code, but it still didn't work. Can you help me to figure out what is the issue? Thank you in advance!

ferzcam commented 1 year ago

Hi. Do you have JDK installed? Which version of JDK are you using?

chestnzu commented 1 year ago

Hi ferzcam: Thank you for replying so quick! I do have JDK installed. the version of JDK in my ubuntu is JDK8

image

other dependencies: pykeen 1.10.1
torch 1.12.1+cu113 gensim 4.3.1

ferzcam commented 1 year ago

You are welcome! Would you please share the version of mowl that was installed from pip and also the script you are trying to run so I can try to reproduce the error?

chestnzu commented 1 year ago

You are welcome! Would you please share the version of mowl that was installed from pip and also the script you are trying to run so I can try to reproduce the error?

Sure! the version of mowl I installed is the latest one (I downloaded from github). I was trying to run the code: import jpype jpype.startJVM(jpype.getDefaultJVMPath()) from mowl.projection.edge import Edge from mowl.datasets.builtin import PPIYeastSlimDataset from mowl.projection import TaxonomyProjector

ds = PPIYeastSlimDataset() proj = TaxonomyProjector(True)

edges = proj.project(ds.ontology)

and I get image

ferzcam commented 1 year ago

I think the problem is the way the JVM is being started. Would you please replace:

import jpype
jpype.startJVM(jpype.getDefaultJVMPath())

by

import mowl
mowl.init_jvm("2g") # feel free to assign the memory you wish

The JVM initialization will be done by mOWL and load all the JAR files. If you initialize the JVM from JPype the necessary JAR files will not be loaded.

Also, if you install from source code please make sure to install the commit of the last release since the current commit might contain undocumented new code.

Please let me know if that solves the error.

chestnzu commented 1 year ago

I think the problem is the way the JVM is being started. Would you please replace:

import jpype
jpype.startJVM(jpype.getDefaultJVMPath())

by

import mowl
mowl.init_jvm("2g") # feel free to assign the memory you wish

The JVM initialization will be done by mOWL and load all the JAR files. If you initialize the JVM from JPype the necessary JAR files will not be loaded.

Also, if you install from source code please make sure to install the commit of the last release since the current commit might contain undocumented new code.

Please let me know if that solves the error.

Thank you! I will have a try tomorrow morning. (A little bit late right now :D) Hope you have a great day!

chestnzu commented 1 year ago

I think the problem is the way the JVM is being started. Would you please replace:

import jpype
jpype.startJVM(jpype.getDefaultJVMPath())

by

import mowl
mowl.init_jvm("2g") # feel free to assign the memory you wish

The JVM initialization will be done by mOWL and load all the JAR files. If you initialize the JVM from JPype the necessary JAR files will not be loaded.

Also, if you install from source code please make sure to install the commit of the last release since the current commit might contain undocumented new code.

Please let me know if that solves the error.

It works! Thanks a lot.