[英]PyTorch is installed. But, When I'm using BertModel, It is giving me following Import error:
I installed and imported PyTorch
.我安装并导入PyTorch
。 Still, I am getting this import error, while I'm using BertModel
.不过,我在使用BertModel
时遇到了这个导入错误。 I need some help here.我需要一些帮助。
Error I'm getting is this:我得到的错误是:
ImportError: BertModel requires the PyTorch library but it was not found in your environment. ImportError: BertModel 需要 PyTorch 库,但在您的环境中找不到。 However, we were able to find a TensorFlow installation.但是,我们能够找到 TensorFlow 安装。 TensorFlow classes begin with "TF", but are otherwise identica TensorFlow 类以“TF”开头,但其他方面相同
I tried this:我试过这个:
model = BertModel.from_pretrained("Rostlab/prot_bert")
I'm getting this:我明白了:
I encountered the same error but it has disappeared after restarting jupyter.我遇到了同样的错误,但是重启jupyter后它就消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.