plasticityai / magnitude

A fast, efficient universal vector embedding utility package.
MIT License
1.63k stars 120 forks source link

!pip install pymagnitude fails on Google Colab #75

Closed Ranapop closed 4 years ago

Ranapop commented 4 years ago

!pip install pymagnitude fails on Google Colab with ERROR: pymagnitude is in an unsupported or invalid wheel

aman31kmr commented 4 years ago

Even I encountered this issue. Then I tried installing it manually and it worked. !git clone https://github.com/plasticityai/magnitude.git cd magnitude/ !python setup.py install It will process for a while, and install!

Kabongosalomon commented 4 years ago

I managed to install the package but, I'm getting this error when loading an embedding.



Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/pymagnitude/__init__.py", line 1045, in get_vectors_mmap
    return (result_key, vec)
  File "/usr/local/lib/python3.6/dist-packages/pymagnitude/__init__.py", line 1157, in _iter
    if len(unseen_indices) > 0:
  File "/usr/local/lib/python3.6/dist-packages/pymagnitude/__init__.py", line 1150, in _iter
  File "/usr/local/lib/python3.6/dist-packages/pymagnitude/__init__.py", line 572, in _db_full_result_to_vec
    InterProcessLock(self.path_to_elmo_w_mmap + '.lock')
  File "/usr/local/lib/python3.6/dist-packages/pymagnitude/__init__.py", line 559, in _db_result_to_vec
    threading.Lock()
ValueError: cannot copy sequence with size 201 to array axis with dimension 200```
AjayP13 commented 4 years ago

Sorry, the Google Colab install breaks due to dependencies, I've added instructions on the README specifically for Google Colab: https://github.com/plasticityai/magnitude#installation

Hope that helps!