Unable to load GPU trained model on machine without a GPU #11999
Replies: 2 comments 1 reply
-
The issue here is that because you're using dill it tries to recreate the same objects, not equivalent ones. If the model is created on GPU then you have cupy tensors, but on a system without a GPU you don't have cupy, so there's no way to create the same object. What you should do in this case is use If it's easier to use dill for some reason, then you can save the model after GPU training and load it on the same machine after calling For more details or other ways to serialize it, see the serialization docs. |
Beta Was this translation helpful? Give feedback.
-
Hi I have decided to take the second aproach and train first with GPU and load it after spacy.require_cpu() is called. However I'm experiancing different kind of issue. When training the model with a custom config I can't save it to disk. The custom config looks like this:
I'm not hundred percent sure where the problem is. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
Currently I am trying to deploy a spacy model which is trained on a GPU due to contained "NER" and "Transformer" in its pipeline. Then the model is pickled using dill and I am trying to load it on a kubernetes pod where there is no GPU available.
Using spacy 3.4.1 and python 3.7
Interestingly before we were able to surpass this obsticle by setting spacy to "spacy.require_cpu" before pickling it. However now we can't due to an error during serialiasing:
The following issue appears when I am trying to load the model on a CPU machine:
Appreciate your help!
Beta Was this translation helpful? Give feedback.
All reactions