python-adagram icon indicating copy to clipboard operation
python-adagram copied to clipboard

train failed, attributeError: __exit__

Open luoyangen opened this issue 7 years ago • 5 comments

while using the command adagram-train input output, it comes to a error that in the learn.py line 30 with ThreadPool(processes=n_workers) as pool:

attributeError: exit

i am wondering if it's my python edition too old(2.7.12)? Should it be python3?

luoyangen avatar May 10 '17 05:05 luoyangen

@luoyangen it should work on Python 2.7, although I mostly tested on Python 3.5. Do you have a full traceback to share?

But also note that training with python-adagram is not recommended yet - it's better to train a model with AdaGram.jl and then convert it to python-adagram format.

lopuhin avatar May 10 '17 06:05 lopuhin

I know this is a year late, but I experienced the same issue, I was able to fix it by making the following change in the source code of python-adagram, in the file learn.py:

Change: with ThreadPool(...) as pool:

into: pool = ThreadPool(...)

This is tested and confirmed working on Python 2.7

On another note, @lopuhin Not sure what the current status of this project is anymore, but has any progress been made on the training portion of it? Or would you still advise that using the Julia version of the library is a safer option?

Regards.

palfi-andras avatar Jun 20 '18 19:06 palfi-andras

@palfi-andras no progress on the training part was made and I'm not working on it at the moment (but occasionally using the library for inference), so training a model with Julia version is still the way to go.

lopuhin avatar Jun 21 '18 09:06 lopuhin

@lopuhin I'm trying to understand the process of AdaGram and maybe use your implementation for my diploma work. Can you please tell what do you think is not working in the training part and maybe I will be helpful to fix it?

natalytvinova avatar Apr 10 '19 18:04 natalytvinova

Nice to hear that @natalytvinova . Unfortunately I don't know why training is not working as expected, but nearest neighbours don't make sense even for single-threaded code. It may be better to use original Julia code as a base, as it produces correct results.

lopuhin avatar Apr 10 '19 18:04 lopuhin