2017-06-14 118 views
0

我正在使用一个开源项目的乐趣,但没有越过它的BH-TSNE通过多处理池的利用。多处理池作业输出

Github的资料来源:

https://github.com/kylemcdonald/AudioNotebooks/blob/master/Fingerprints%20to%20t-SNE.ipynb

特定的错误:

data = data.astype(np.float64) 
def job(params): 
    start = time() 
    tsne(data, data_root, mode, initial_dims=params[0], perplexity=params[1]) 
    print 'initial_dims={}, perplexity={}, {} seconds'.format(params[0], params[1], time() - start) 
params = list(itertools.product(initial_dims, perplexities)) 
pool = Pool() 
pool.map(job, params) 

utils/bhtsne.py:129: ComplexWarning: Casting complex values to real discards the imaginary part 
    for sample in samples: 
--------------------------------------------------------------------------- 
AssertionError       Traceback (most recent call last) 
<ipython-input-22-0350579d447b> in <module>() 
     7 params = list(itertools.product(initial_dims, perplexities)) 
     8 pool = Pool() 
----> 9 pool.map(job, params) 

/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.pyc in map(self, func, iterable, chunksize) 
    249   ''' 
    250   assert self._state == RUN 
--> 251   return self.map_async(func, iterable, chunksize).get() 
    252 
    253  def imap(self, func, iterable, chunksize=1): 

/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.pyc in get(self, timeout) 
    565    return self._value 
    566   else: 
--> 567    raise self._value 
    568 
    569  def _set(self, i, obj): 

AssertionError: ERROR: Call to bh_tsne exited with a non-zero return code exit status, please refer to the bh_tsne output for further details 

我有bh_tsne包装,二进制太..

包装来源:https://github.com/lvdmaaten/bhtsne

但不清楚我如何看待子流程输出。

看着一些谷歌搜索,在包装上,以默认打开详细模式..但没有输出似乎出现无论是在DIR或Jupyter笔记本

回答

1

这样看来,Jupyter笔记本电脑不玩好这种类型的代码..但它竟然是我的电脑环境下的问题..只好从源代码编译numpy用的东西启用

https://github.com/numpy/numpy/issues/9254

最重要的是..如果你在jupyter崩溃笔记本电脑,而粗俗发生在一个池内的线程中re无法看到跟踪AFAIK ..而解决的办法是直接在笔记本上运行代码或切换到非iPython