allenai / allennlp

An open-source NLP research library, built on PyTorch.
http://www.allennlp.org
Apache License 2.0
11.72k stars 2.25k forks source link

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

Closed XiepengLi closed 2 years ago

XiepengLi commented 2 years ago
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'
inwonakng commented 2 years ago

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

TylerReedMC commented 2 years ago

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

inwonakng commented 2 years ago

@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

AkshitaB commented 2 years ago

This should be fixed in the main branch now.