deepinsight / deepinsight/insightface

scrfd2onnx.py torch.load(map_location='gpu')

Open
#2,109 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

windows10
Traceback (most recent call last):
File "D:/AIProject/insightface0.4/test1.py", line 2, in
checkpoint = torch.load("insightface-master/detection/scrfd/weights/scrfd_10g_bnkps.pth", map_location='gpu')
File "D:\Miniconda3\envs\insightface0.4\lib\site-packages\torch\serialization.py", line 608, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "D:\Miniconda3\envs\insightface0.4\lib\site-packages\torch\serialization.py", line 787, in _legacy_load
result = unpickler.load()
File "D:\Miniconda3\envs\insightface0.4\lib\site-packages\torch\serialization.py", line 743, in persistent_load
deserialized_objects[root_key] = restore_location(obj, location)
File "D:\Miniconda3\envs\insightface0.4\lib\site-packages\torch\serialization.py", line 824, in restore_location
return default_restore_location(storage, map_location)
File "D:\Miniconda3\envs\insightface0.4\lib\site-packages\torch\serialization.py", line 180, in default_restore_location
+ location + ")")
don't know how to restore data location of torch.FloatStorage (tagged with gpu)
**I dont know why**
### My solution
torch.load(map_location='cuda:0')

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.