mirror of
https://github.com/KaiyangZhou/deep-person-reid.git
synced 2025-06-03 14:53:23 +08:00
FeatureExtractor: avoid loading weights twice
When passing a model_path to the FeatureExtractor, weights are loaded twice. One the pretrained once and then the given ones. Avoid the unnecessary load.
This commit is contained in:
parent
6987d99074
commit
42185c4beb
@ -71,7 +71,7 @@ class FeatureExtractor(object):
|
||||
model = build_model(
|
||||
model_name,
|
||||
num_classes=1,
|
||||
pretrained=True,
|
||||
pretrained=not (model_path and check_isfile(model_path)),
|
||||
use_gpu=device.startswith('cuda')
|
||||
)
|
||||
model.eval()
|
||||
|
Loading…
x
Reference in New Issue
Block a user