Open Harish-Sundaravel opened 2 months ago
I’m encountering issues when trying to convert my YOLOv8x model from torchScript to torch_neuron on Kaggle. Here are the details:
YOLOv8x Model (Single Class):
YOLOv8x Model (Two Classes):
Code Used for Conversion:
Converting .pt file to torchscript: model = YOLO('my_yolov8x.pt') [# Attempting Half Precision: model.model.half() # Converts from torch.float32 to torch.float16] - tried this too! model.export(format='torchscript', imgsz=1024) #creates my_yolov8x.torchscript file
Converting torchscript to torch_neuron: model = torch.jit.load("/kaggle/input/my_yolov8x.torchscript") model = model.float().eval()
example_input = torch.rand(1, 3, 1024, 1024) neuron_model = torch_neuron.trace(model, example_input) neuron_model.save('my_yolov8x.neuron')
Problem: When converting the model trained with two classes, the process is extremely slow and consumes excessive memory, resulting in failure.
If anyone has insights or solutions to address this issue, your help would be greatly appreciated.
Thank you in advance!
I’m encountering issues when trying to convert my YOLOv8x model from torchScript to torch_neuron on Kaggle. Here are the details:
YOLOv8x Model (Single Class):
YOLOv8x Model (Two Classes):
Code Used for Conversion:
Converting .pt file to torchscript: model = YOLO('my_yolov8x.pt') [# Attempting Half Precision: model.model.half() # Converts from torch.float32 to torch.float16] - tried this too! model.export(format='torchscript', imgsz=1024) #creates my_yolov8x.torchscript file
Converting torchscript to torch_neuron: model = torch.jit.load("/kaggle/input/my_yolov8x.torchscript") model = model.float().eval()
example_input = torch.rand(1, 3, 1024, 1024) neuron_model = torch_neuron.trace(model, example_input) neuron_model.save('my_yolov8x.neuron')
Problem: When converting the model trained with two classes, the process is extremely slow and consumes excessive memory, resulting in failure.
If anyone has insights or solutions to address this issue, your help would be greatly appreciated.
Thank you in advance!