Comments (7)
Well i found ... it does not work inside jupyter because it need to run directly , In short, the subprocesses do not know they are subprocesses and are attempting to run the main script recursively.
So don't use jupyter for multiprocessing ...
from wordbatch.
Hi.
I would just like to add, as a fairly novice programmer, that I experience exactly the same problem on Linux Ubuntu and Mint
when using the python wrapper Idle. Programmes using the multiprocessing module just hang for ever - even CTRL-C will not interrupt the endless loop.
However, running Python from the command line gives flawless execution.
I have had exactly the same frustrations when writing bits of code using the Curses module. They work fine from the command line but will not run in IDLE.
The reason, I think, is although it looks as though the IDLE window (and I guess Jupyter too -though I've not used that ) is some kind of terminal window, in fact it is no such thing and the overheads in having this so-called user-friendly environment are stopping Python from its usual memory management tasks.
Moral of the story: Stick to a basic editor and the command line.
from wordbatch.
Jupyter shouldn't have problems with multiprocessing, since this is basic Python functionality. This could still be a Windows issue, or issue with Windows & Python3. The library was initially developed under Windows & Python2, and there were no issues with multiprocessing earlier.
Windows uses spawn, linux uses fork to create the subprocesses. This introduced some differences in behaviour under Python2.
Most often multiprocessing with Wordbatch hangs due to not enough memory to start a new worker. Unfortunately there's no signal from a hanging subprocess to multiprocessing, so it's not possible to know when a subprocess has hanged. Modifying the multiprocessing library to catch hanging subprocesses could help debug and fix issues like this.
from wordbatch.
The strange is if I execute from the command line it works flawless with multiprocessing... I've 128gb ram locally, and the max consumption that i tested was a matrix of (14689280, 8388608) that took 25gb of ram and 240 secs to execute with 8 procs from the command line...
From jupyter even if I try the (14345, 8388608) matrix it goes no where with multiprocessing, but works with serial...
from wordbatch.
maybe is something like this
jupyter/notebook#1703
from wordbatch.
@anttttti I've reproduced the error using a very simple function. It does seem to be a problem with Windows and Jupyter. It's not clear to me as to why it does not work. I've posted my short example in a stackoverflow post here.
from wordbatch.
@anttttti I've reproduced the error using a very simple function. It does seem to be a problem with Windows and Jupyter. It's not clear to me as to why it does not work. I've posted my short example in a stackoverflow post here.
Thanks for reporting this. Strange that Jupyter does that. With Wordbatch 1.4 you can try Dask, Ray, Spark or Loky as an alternative backend, to see if those better with Jupyter.
from wordbatch.
Related Issues (20)
- WordVec extractor failing due to decode error HOT 1
- cannot install on windows 8.1 HOT 4
- "Illegal operation" when importing wordbatch.extractors HOT 2
- Licensing for commercial use without open source? HOT 1
- Tried to pickle the fitted wordbatch model, but bumped into this Error: AttributeError: 'function' object has no attribute 'im_self' HOT 3
- Import FTRL fails HOT 1
- Error on trying to import FM_FTRL HOT 1
- predict() takes a very long time HOT 1
- from wordbatch.data_utils import * HOT 3
- IndexError: too many indices for array HOT 1
- Illegal instruction (core dumped) HOT 1
- TypeError: only size-1 arrays can be converted to Python scalars (Windows, Python 3.5) HOT 1
- are this times normal? HOT 2
- AttributeError: Can't get attribute 'normalize_text' on <module '__main__'> HOT 1
- About Wordbatch HOT 2
- pip install wordbatch on macos---error: command 'gcc-7' failed with exit status 1
- 'tuple' object has no attribute 'transform' HOT 3
- cross validation and grid search HOT 3
- will it work for Windows ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordbatch.