In YOLO NAS i convert best.pth to custom.onnx but it can't execute the output
import torch from super_gradients.training import models from super_gradients.common.object_names import Models
model = models.get('yolo_nas_s', num_classes = 1,checkpoint_path ="best.pth") img="3.jpg"
It's work as well
model.predict(img).show()
Here, i convert .pth to .onnx
models.convert_to_onnx(model=model,input_shape=(3,640,640),out_path="custom.onnx")
after the conversion load the .onnx model
model = models.get('yolo_nas_s', num_classes = 1,checkpoint_path ="custom.onnx")
model.predict(img).show()
============================================================= output: Traceback (most recent call last): File "yolo nas.py", line 8, in model =models.get("best.pth", num_classes = 1,checkpoint_path=model_path) File "C:\Users\pc\anaconda3\envs\yolonas\lib\site-packages\super_gradients\training\models\model_factory.py", line 197, in get net = instantiate_model(model_name, arch_params, checkpoint_num_classes, pretrained_weights, download_required_code) File "C:\Users\pc\anaconda3\envs\yolonas\lib\site-packages\super_gradients\training\models\model_factory.py", line 103, in instantiate_model architecture_cls, arch_params, pretrained_weights_path, is_remote = get_architecture(model_name, arch_params, download_required_code) File "C:\Users\pc\anaconda3\envs\yolonas\lib\site-packages\super_gradients\training\models\model_factory.py", line 73, in get_architecture raise UnknownTypeException( super_gradients.common.exceptions.factory_exceptions.UnknownTypeException: The required model, "C:/Users/pc/Downloads/best.pth", was not found in SuperGradients. See docs or all_architectures.py for supported model names.