Using Spacys en_core_web_trf not working #11409
-
Hi! I want to train models based on some of spacy's given language models. For that, I do not wish to use in-code solutions as they have been suggested fairly often but I'd rather like to use a solution via the config file. Now, I have made this work nicely for spacy.prefer_gpu()
try:
train(config_file, output_dir, overrides={"paths.train": training_docbin_file, "paths.dev": testing_docbin_file})
except:
raise FailedTrainingException() returns the following output (I had to save it to a txt file so the format is a little.. off): #16 22.65 Successfully installed en-core-web-trf-3.4.0
#16 22.66 WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available.
#16 22.66 You should consider upgrading via the '/opt/venv/bin/python -m pip install --upgrade pip' command.
#16 22.76 �[38;5;2m✔ Download and installation successful�[0m
#16 22.76 You can now load the package via spacy.load('en_core_web_trf')
#16 22.76 �[38;5;4mℹ Saving to output directory: /code/app/spacy_model/output�[0m
#16 22.76 �[38;5;4mℹ Using CPU�[0m
#16 22.76 �[1m
#16 22.76 =========================== Initializing pipeline ===========================�[0m
#16 24.94 �[38;5;2m✔ Initialized pipeline�[0m
#16 24.94 �[1m
#16 24.94 ============================= Training pipeline =============================�[0m
#16 24.95 �[38;5;4mℹ Pipeline: ['transformer', 'tagger', 'parser', 'ner']�[0m
#16 24.95 �[38;5;4mℹ Initial learn rate: 0.0�[0m
#16 24.95 E # LOSS TRANS... LOSS TAGGER LOSS PARSER LOSS NER TAG_ACC DEP_UAS DEP_LAS SENTS_F ENTS_F ENTS_P ENTS_R SCORE
#16 24.95 --- ------ ------------- ----------- ----------- -------- ------- ------- ------- ------- ------ ------ ------ ------
#16 25.06 /opt/venv/lib/python3.8/site-packages/torch/amp/autocast_mode.py:198: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling
#16 25.06 warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling')
#16 34.63 0 0 314.90 0.00 0.00 398.72 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 and just, doesn't do anything else. It does still load but nothing actually happens as I am assuming my CPU does not suffice even though it is fairly good(?). I can't start it via console because afaik my GPU ID would be 0 and Spacy tells me there is no GPU there ( 2022-08-30 14:09:56.600666: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:939] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-08-30 14:09:56.618808: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:939] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-08-30 14:09:56.618932: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:939] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero The other models I used had the pipeline
If it's relevant, my
Now I assume I might need to install some spacy-cuda package but I'm unsure if that's the error and what to install exactly. I've done my research but it seems like every page states something else and I'd rather find a solution here (where it is trustworthy) than somewhere else. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
It looks like the issue is that you don't have cupy or torch (or possibly other GPU requirments) installed. You can check the version of CUDA you have using |
Beta Was this translation helpful? Give feedback.
It looks like the issue is that you don't have cupy or torch (or possibly other GPU requirments) installed.
You can check the version of CUDA you have using
nvcc --version
. After you determine that you can install a compatible version of Torch by following directions on their site, and you can install everything needed for spaCy by selecting the GPU option in the quickstart widget. Let me know if that doesn't work.