Open aldrinc opened 5 years ago
You need to also turn the flag model._use_cuda
off. Otherwise the input will be converted to cuda tensors: sequence_var = gpu(sequences, self._use_cuda)
That's correct. There really should be a better way of doing this but I'm short on time and GPU testing runs.
Hi - I trained an Implicit Sequence Model and loaded it in my Flask API for serving locally on my machine and I cannot seem to get CPU inference working.
The model works correctly when a GPU is available.
Steps to recreate:
Run flask server locally e.g. model = torch.load('./my_model_v0.13.pt', map_location='cpu')`
Post a JSON payload with sequence values. I've already tested that the server can correctly parse the response.
Server error when model attempts to predict
preds = model.predict(arr)
RuntimeError: torch.cuda.LongTensor is not enabled.
More trace below.