python-adagram
python-adagram copied to clipboard
train failed, attributeError: __exit__
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 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.
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 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 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?
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.