Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU and GPU usage using osnet_x1_0_imagenet.pth #553

Open
Umraz-Hussain-MyWorld opened this issue Aug 25, 2023 · 1 comment
Open

CPU and GPU usage using osnet_x1_0_imagenet.pth #553

Umraz-Hussain-MyWorld opened this issue Aug 25, 2023 · 1 comment

Comments

@Umraz-Hussain-MyWorld
Copy link

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

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}") 
@a2082761
Copy link

I have same issue. I am using osnet_x1_0 model with pretrained by Market1501 dataset.
If you are passing by and know, please reply to this.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants