Convert PyTorch YOLOv5s model to ONNX or tensorflow format from google colab

torch.load() only loads the “state_dict”, this is NOT the actual model.

but i’m a bit confused here, there is some code like:

model = torch.load("weights/yolov5s.pt")['model']

on the other hand, the usual way to load a pytorch model is:

model = SomeNetwork() # first construct an empty nn from *code*
model.load_state_dict( torch.load("my.pth")) # fill in data