Skip to content

Issue 34 #43

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions fastxml/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ def f2(*args):
def fork_call(f):
def f2(*args):
queue = multiprocessing.Queue(1)
p = multiprocessing.Process(target=_remote_call, args=(queue, f, args))
p.start()
ctx = multiprocessing.get_context('fork')
p = ctx.Process(target=_remote_call, args=(queue, f, args))
if __name__ == '__main__':
p.start()
return ForkResult(queue, p)

return f2
Expand Down
3 changes: 2 additions & 1 deletion fastxml/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ def f(node):
return Tree(rootIdx, W_stack, b, t, probs)

def fit(self, X, y, weights=None):
self.roots = self._build_roots(X, y, weights)
if __name__ == '__main__':
self.roots = self._build_roots(X, y, weights)
if self.leaf_classifiers:
self.norms_, self.uxs_, self.xr_ = self._compute_leaf_probs(X, y)

Expand Down