You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/data/orlando/home/ndavid/miniconda3/envs/embedding/lib/python3.12/site-packages/gensim/utils.py", line 763, in save
_pickle.dump(self, fname_or_handle, protocol=pickle_protocol)
TypeError: file must have a 'write' attribute
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ndavid/code/embedding_training/scripts/subword_embedding_training.py", line 144, in <module>
main()
File "/home/ndavid/code/embedding_training/scripts/subword_embedding_training.py", line 140, in main
model.save(args.model_file)
File "/data/orlando/home/ndavid/miniconda3/envs/embedding/lib/python3.12/site-packages/gensim/models/word2vec.py", line 1923, in save
super(Word2Vec, self).save(*args, **kwargs)
File "/data/orlando/home/ndavid/miniconda3/envs/embedding/lib/python3.12/site-packages/gensim/utils.py", line 766, in save
self._smart_save(fname_or_handle, separately, sep_limit, ignore, pickle_protocol=pickle_protocol)
File "/data/orlando/home/ndavid/miniconda3/envs/embedding/lib/python3.12/site-packages/gensim/utils.py", line 604, in _smart_save
compress, subname = SaveLoad._adapt_by_suffix(fname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/orlando/home/ndavid/miniconda3/envs/embedding/lib/python3.12/site-packages/gensim/utils.py", line 572, in _adapt_by_suffix
compress, suffix = (True, 'npz') if fname.endswith('.gz') or fname.endswith('.bz2') else (False, 'npy')
^^^^^^^^^^^^^^
AttributeError: 'PosixPath' object has no attribute 'endswith'
pathlib has been an integral part of the Python standard library since version 3.4 (more than 10 years ago), and it makes working with file paths much easier. Please add support for it in the library.
The text was updated successfully, but these errors were encountered:
@123Soham-bhatia Of course, I would be happy to see this being worked on. I am not a Gensim developer, however, so I won't be able to guide you / merge the PR.
I got this error after 2 days of training:
pathlib
has been an integral part of the Python standard library since version 3.4 (more than 10 years ago), and it makes working with file paths much easier. Please add support for it in the library.The text was updated successfully, but these errors were encountered: