今天跑huggingface示例的时候,发现有下面的报错:
Traceback (most recent call last):
File "F:\transformer\transformers\examples\pytorch\image-classification\run_image_classification.py", line 451, in <module>
main()
File "F:\transformer\transformers\examples\pytorch\image-classification\run_image_classification.py", line 256, in main
dataset = load_dataset(
File "F:\anaconda\envs\gpu\lib\site-packages\datasets\load.py", line 2143, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "F:\anaconda\envs\gpu\lib\site-packages\datasets\builder.py", line 1173, in as_dataset
raise NotImplementedError(f"Loading a dataset cached in a {type(self._fs).__name__} is not supported.")
NotImplementedError: Loading a dataset cached in a LocalFileSystem is not supported.
可以发现,datasets这个库出了问题,经过上网查资料,发现是版本太过落后,解决方案如下:先升级pip到最新版本,然后更新datasets
python -m pip install --upgrade pip
pip install -U datasets
成功!