-
Notifications
You must be signed in to change notification settings - Fork 217
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
load model from word2vec:PythonShell-ParseError #52
Comments
It looks like this Python script is writing to stderr for logging, which is not unusual. Some programs prefer tracing to stderr to suppress noise from stdout and keep the output clean. However, python-shell sees that as an error and throws whatever was read from stderr. I see two options:
|
Thank you so much. There is no error after I remove the logging |
Hi! How to use python shell with sails.js. ? I want to pass an image from my controller.js to a python object and wait for a json output from the .py object ? how is that possible and whats the proper way of doing it ? thanks |
Hi~
I have just run the word2vec model by using genesis module and save the model. And I want to call python in my sails app and load the model I have generated. And I got the following error. I have spending so much time on that but still couldn't figure out what's run.
Thanks ahead for your help!
here is my code:
word2vec.py
import collections
import gensim, logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
model = gensim.models.Word2Vec.load('course_word2vec')
CourseController.js
var PythonShell = require('python-shell');
var courseid=req.param('courseid');
sails.log.debug(coursed);
var options = {
args: [courseid]
};
PythonShell.run('word2vec.py', options, function (err, results) {
if (err) throw err;
console.log('results: %s', results[0]);
});
return res.ok();
and the error is
`/Users/luoyuetian/Desktop/junior/summerproject/course_recommendation_interface/api/controllers/SimilarcourseController.js:41
if (err) throw err;
^
Error: 2016-08-09 20:51:11,742 : INFO : loading Word2Vec object from course_word2vec
2016-08-09 20:51:11,804 : INFO : setting ignored attribute syn0norm to None
2016-08-09 20:51:11,804 : INFO : setting ignored attribute cum_table to None
`
The text was updated successfully, but these errors were encountered: