问题
运行 huggingface transformers 的 demo,报错FloatProgress not found。具体如下:
import torch
from transformers import BertTokenizer, BertModel, BertForMaskedLM
import logging
logging.basicConfig(level=logging.INFO)
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
报错:
filelock:Lock 140228336084248 acquired on
......
ImportError: IntProgress not found. Please update jupyter and ipywidgets.
解决:
添加 from ipywidgets import IntProgress
import torch
from ipywidgets import IntProgress
from transformers import BertTokenizer, BertModel, BertForMaskedLM
import logging
logging.basicConfig(level=logging.INFO)
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')