goru001 / inltk

Natural Language Toolkit for Indic Languages aims to provide out of the box support for various NLP tasks that an application developer might need
https://inltk.readthedocs.io
MIT License
818 stars 164 forks source link

LSTM' object has no attribute '_flat_weights_names' #92

Open Onkar-2803 opened 1 year ago

Onkar-2803 commented 1 year ago

Have executed the collab notebook provided by you, I'm still getting the same error.

It seems version 1.3.1 of torch has been removed

To generate the error: !pip install inltk !pip install torch==1.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html from inltk.inltk import setup setup('hi') from inltk.inltk import get_embedding_vectors vectors = get_embedding_vectors('भारत', 'hi') vectors[0].shape

OmkarDhekane commented 1 year ago

I'm getting same error. @Onkar-2803 Did you get any solution for this?

Onkar-2803 commented 1 year ago

Hey, this seems like an error due to the python version. You'll need to downgrade your python.

OmkarDhekane commented 1 year ago

After downgrading the python version to 3.7.16, the installation commands,

!pip install inltk !pip install torch==1.3.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

throws following error ->

Traceback (most recent call last): File "/usr/local/bin/pip3", line 5, in from pip._internal.cli.main import main File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in from pip._internal.cli.autocompletion import autocomplete File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in from pip._internal.cli.main_parser import create_main_parser File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in from pip._internal.cli import cmdoptions File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 19, in from distutils.util import strtobool ModuleNotFoundError: No module named 'distutils.util' Traceback (most recent call last): File "/usr/local/bin/pip3", line 5, in from pip._internal.cli.main import main File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in from pip._internal.cli.autocompletion import autocomplete File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in from pip._internal.cli.main_parser import create_main_parser File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in from pip._internal.cli import cmdoptions File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 19, in from distutils.util import strtobool ModuleNotFoundError: No module named 'distutils.util'

Onkar-2803 commented 1 year ago

Can you try to downgrade to python==3.6.9 and check if it works? This worked for me.

pradhanashwin commented 1 year ago

i am on python 3.9. and have same issue. anyone has solutions for this

Onkar-2803 commented 1 year ago

Try Python version 3.6.9