You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upon loading the model and configuring it with CUDA, it is expected to utilize the GPU exclusively. However, it has been observed that the model is consuming 2.3GB of GPU and an additional 4GB of CPU, which is unexpected. Further experimentation with the device parameter revealed that using the CPU resulted in lower CPU consumption (~300MB) and no GPU usage, albeit at the cost of increased processing time. The reason for the model's high usage of both CPU and GPU remains unclear. Further investigation is required to determine the root cause of this behavior. any suggestions?
below is the sample model loading code
from torchreid import models, utils
class ModelLoader:
osnet_model = None
@staticmethod
def get_model():
if ModelLoader.osnet_model is None:
ModelLoader.osnet_model = utils.FeatureExtractor(
model_name='osnet_x1_0',
model_path='osnet_x1_0_imagenet.pth',
device='cuda:0'
)
return ModelLoader.osnet_model
# load model
model_load_time = time.time()
try:
feature_extractor_model = ModelLoader.get_model()
logger.debug("model is loaded")
except Exception as e:
# print(f'{e}')
logger.error(f"exception while loading model: {e}")
The text was updated successfully, but these errors were encountered:
Hi,
Upon loading the model and configuring it with CUDA, it is expected to utilize the GPU exclusively. However, it has been observed that the model is consuming 2.3GB of GPU and an additional 4GB of CPU, which is unexpected. Further experimentation with the device parameter revealed that using the CPU resulted in lower CPU consumption (~300MB) and no GPU usage, albeit at the cost of increased processing time. The reason for the model's high usage of both CPU and GPU remains unclear. Further investigation is required to determine the root cause of this behavior. any suggestions?
below is the sample model loading code
The text was updated successfully, but these errors were encountered: