T5Tokenizer requires the SentencePiece library but it was not found in your environment.

出现错误: T5Tokenizer requires the SentencePiece library but it was not found in your environment.

问题出现是因为我要使用T5Tokenizer

from transformers import AdamW, T5ForConditionalGeneration, T5Tokenizer

出现如下问题:
在这里插入图片描述
解决方法:
第一步:确实用最新的pip 安装, 否则可能会出现错误

pip install --upgrade pip

第二步:安装报错的SentencePiece

pip install SentencePiece

问题解决

你可能感兴趣的:(python,bug,python)