Getting Segmentation Fault error while trying execute scheme code using the python api

51 views
Skip to first unread message

Xabush Semrie

unread,
Dec 28, 2017, 11:59:36 AM12/28/17
to opencog
I have MOSES training results in scheme format that is I want to import to the atomspace. I am using the OpenCog python api to access the atomsapce and import the results, However, in trying to do I am getting "Segmentation fault (core dumped)" error. To demonstrate what I am trying to do, here is a snippet of code I am using.

from opencog.scheme_wrapper import scheme_eval, scheme_eval_as

atomspace
= scheme_eval_as('(cog-atomspace)')



with open('/path/to/the/result_file', 'r') as fp:
 scm
= fp.read()
response
= scheme_eval(atomspace, scm) #this is line is the cause of the error.


When I instantiate the atomspace using its constructor, the above error does NOT happen. The problem in instantiating the atomspace through the constructor is that I cannot get response when I use the atomspace instance with the OpenCog REST API. What can be the cause this error? How can I resolve it?

P.S: I have attached the results file so that you can take a look at it.

Thanks in advance.
5a3baf4d2ae73d112d2926a9

Linas Vepstas

unread,
Jan 2, 2018, 11:00:26 PM1/2/18
to opencog
Is this still an issue?

I just tried it; using "foo.scm"   which contained:

(use-modules (opencog))

(Concept "foobar")

(display "ollllaaa\n")

(Concept "barfoo")


I got no error, and this output:

>>> response = scheme_eval(atomspace, scm)
>>> print response
ollllaaa
#<Invalid handle>


You probably should open a github issue to track this.

--linas
 

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/54b110a1-29bf-477a-a56d-cf5362b4c026%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
"The problem is not that artificial intelligence will get too smart and take over the world," computer scientist Pedro Domingos writes, "the problem is that it's too stupid and already has."

Xabush Semrie

unread,
Jan 3, 2018, 9:51:23 AM1/3/18
to opencog
I tried using your example and still getting the same error. For clarity here is what I tried to run in python:

from opencog.scheme_wrapper import scheme_eval, scheme_eval_as


atomspace
= scheme_eval_as('(cog-atomspace)')


with open('foo.scm', 'r') as fp:
 scm
= fp.read()


response
= scheme_eval(atomspace, scm) #Segfault occurs here

And also, I will post an issue on the OpenCog repo.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/54b110a1-29bf-477a-a56d-cf5362b4c026%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Duncan

unread,
Jan 3, 2018, 2:56:31 PM1/3/18
to opencog
i get a segfault also, you should post a githubb issue.
Reply all
Reply to author
Forward
0 new messages