tensorflow spacy bert uncased model. help cannot download

elcex8rz  于 2023-11-21  发布在  其他
关注(0)|答案(1)|浏览(161)

我试着在Google collaboratory上运行这个
第一个月
我希望使用该模型进行文本分类。
但我无法安装此模型,我一直得到这个错误:

2023-10-26 18:22:02.571699: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2023-10-26 18:22:02.571769: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2023-10-26 18:22:02.571814: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-10-26 18:22:02.580822: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-10-26 18:22:03.859736: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

✘ No compatible package found for 'en_trf_xlnetbasecased_lg' (spaCy
v3.7.2)

字符串
我应该做什么,因为我已经安装了最新版本的spaCy。我很感激和感谢任何帮助,你可以给予

aij0ehis

aij0ehis1#

由于spacy2.x版本到3.x版本中的Transformer模型的name change,您需要将模型名称en_trf_xlnetbasecased_lg替换为en_core_web_trf。在google colab中,您可能还需要单独安装spacy_transformers。使用以下命令:

!pip install spacy[transformers]
!python -m spacy download en_core_web_trf

字符串
下载模型后,您可以通过以下方式使用它:

import spacy
nlp = spacy.load('en_core_web_trf')


测试它与spacy 3.6.1和它的工作正常!

相关问题