av-savchenko / hsemotion

HSEmotion Python library for facial expression recognition
Apache License 2.0
23 stars 7 forks source link

Add `map_location` for cpu inference #1

Closed echuraev closed 1 year ago

echuraev commented 1 year ago

Probably it is not a bug for the current models, but I hacked this script locally to run some other models (e.g. state_vggface2_enet0_new.pt). And I wasn't able to run it because of the following error:

Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

Using map_location should help to avoid such problem.