Hi, I've followed yolo_nas_custom_dataset_fine_tuning_with_qat.ipynb this tutorial notebook. And I've got 'ckpt_best.pth' and 'yolo_nas_m_cppe-5_qat_1x3x640x640_ptq.onnx' at my ckpt directory. Now I want convert this model to pb file (frozenGraph or savedModel). So I've googled and built the theory as follows:
# In Theory
import torch
from your_model_module import ModelClass
pth_path = "experiments/yolo_nas_m_cppe-5_qat/RUN_20240222_201118_772223/ckpt_best.pth"
model_state_dict = torch.load(pth_path)
print(model_state_dict.keys())
model = ModelClass()
model_state_dict = torch.load(pth_path)
model.load_state_dict(model_state_dict)
model.eval()
# pytorch2keras
How can I instantiate ModelClass , in this case YOLO_NAS_M, and load state dictionary and run model.eval()?
frozenGraph or savedModel suggest Tensorflow models. It is unclear for me why it is mentioned in the context of this repo. Please clarify your question since I'm unable to follow your question.
💡 Your Question
Hi, I've followed yolo_nas_custom_dataset_fine_tuning_with_qat.ipynb this tutorial notebook. And I've got 'ckpt_best.pth' and 'yolo_nas_m_cppe-5_qat_1x3x640x640_ptq.onnx' at my ckpt directory. Now I want convert this model to pb file (frozenGraph or savedModel). So I've googled and built the theory as follows:
How can I instantiate
ModelClass
, in this case YOLO_NAS_M, and load state dictionary and runmodel.eval()
?Thanks.
Versions
super-gradients 3.6.1 onnx 1.15.0 onnx-tf 1.9.0 onnx2keras 0.0.24 onnx2tf 1.17.5 onnxoptimizer 0.3.13 onnxruntime 1.15.0