zaburo-ch / Parametric-t-SNE-in-Keras

a python implementation of Parametric t-SNE in Keras
60 stars 26 forks source link

multi asyn processing fails: result = pool.map(x2p_job, generator()) goes to timeout #4

Open kamae opened 6 years ago

kamae commented 6 years ago

I am a novice and likely be asking a trivial question. mlp_param_tsne.py def x2p_job(data): requires data but result = pool.map(x2p_job, generator()) in def x2p(X) is not giving data. For mnist which and what format should I give to run this program? Thanks for the help.

kamae commented 6 years ago

I checked a little further.

result = pool.map(x2p_job, generator())

def get(self, timeout=None): in \anaconda3\lib\multiprocessing\pool.py(637)get()

zaburo-ch commented 6 years ago

Hi kamae, thank you for your interest in this repository.

I used multiprocessing library in this procedure, which allow us to easily write multi process computation. Its documentation is here. It might help you.

By the way, you seem to be using python 3 (by anaconda3). In this code, python 2.7 is used because I wrote this a long time ago. Thus, if you execute this code using python 2.7 and Keras 1.0.3, it may work well.

buaahsh commented 5 years ago

@kamae Hi Kamae, I remove the pool part and use for loop directly, which works for me. The following for your reference.

    # pool = mp.Pool(n_jobs)
    # result = pool.map(x2p_job, generator())
    result = []
    for i in range(n):
        result.append(x2p_job([i, D[i], tol, logU]))