Skip to content

How can I move and run the classification model out of YOLOV5 codebase?  #8790

@AI-Passionner

Description

@AI-Passionner

Search before asking

Question

It seems that loading the classification model can't leave out of the YOLOV5-Classifier code base. When loading the model,
model = torch.load('path/to/best.pt', map_location=torch.device('cpu'))['model'].float(), it throws error like this
"""
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'models'
"""
Once the folders of models and utils are copied to a new project directory, the loading works.

I am asking if there is a way I can load the classification model and use it as a stand-alone and for example, converting to TensorFlow like the object detection codebase.
As I know, the YOLOV5 object detection doesn't have this problem.

Thanks.

Additional

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions