allenai / allennlp

An open-source NLP research library, built on PyTorch.

Home Page:http://www.allennlp.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'cached_path' has no attribute 'file_friendly_logging'

XiepengLi opened this issue · comments

File "/usr/local/lib/python3.8/site-packages/allennlp/predictors/predictor.py", line 366, in from_path
    load_archive(archive_path, cuda_device=cuda_device, overrides=overrides),
  File "/usr/local/lib/python3.8/site-packages/allennlp/models/archival.py", line 206, in load_archive
    resolved_archive_file = cached_path(archive_file)
  File "/usr/local/lib/python3.8/site-packages/allennlp/common/file_utils.py", line 135, in cached_path
    _cached_path.file_friendly_logging(common_logging.FILE_FRIENDLY_LOGGING)
AttributeError: module 'cached_path' has no attribute 'file_friendly_logging'

I had the same issue, found that cached-path was updated to version 1.1.3 which caused the error
For the time being, I was able to bypass this issue by force installing cached-path==1.1.2 after installing allennlp modules on my runtime

Same issue here. How do you force the cached-path?

@TylerReedMC

pip install allennlp allennlp-models
pip install cached-path==1.1.2

I just re-installed cached-path with the version specified after installing allennlp modules and it seems to have overridden the updated version installed by allennlp dependencies

This should be fixed in the main branch now.