New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how do i use a pre-trained model on CPU? #54
Comments
generate.py
using pretrained model on CPU?
Hi, so we unfortunately do not officially support the generate.py script anymore as it doesn’t make sense with our most recent set of classifiers. Also we removed the —cpu option as we try and set device automatically now. Two other questions:
|
1I had installed apex using pip with git+http --
follow upyour response alerted me to the fact that apex was already installed using
the problem is reproduced with the in-repo apex installation as well. 2I edited
then the size mismatches appear as I reported earlier --
i.e the problem is the 256/257 mismatch in the saved model and the expected dimension. |
Thanks for alerting us to the apex install problem, I'll try and get a fix out for that. As for the mismatch problem, you'll notice that in our pretraining script we set the data_size to be equivalent to tokenizer.num_tokens. This is because our tokenizer has some extra tokens for padding. In future updates we'll be releasing an embedding data structure that manages embedding sizes from the number of tokens for you automatically so you don't have to worry about this. |
The apex install conflicts should be fixed now. |
I tried the following command.
I also tried using
model.cpu()
whentorch.cuda.is_available()
isFalse
. I also tried usingload
withmap_location='cpu'
... which led to inconsistencies in tensor/ndarray sizes.PS: I didn't find a
--cpu
option in the docs. Others have discussed running a model on the CPU - but I didn't find anything else.PPS: I am using
pytorch-cpu
version0.4.1=py36_cpu_1
from the condapytorch
channel.The text was updated successfully, but these errors were encountered: