Skip to content

Commit

Permalink
Only need onnx export function in export
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Nov 5, 2023
1 parent ddc1a67 commit 509edd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/im2txt/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from PIL import Image
from torchvision import transforms

from torch.onnx import export, dynamo_export
from api.im2txt.model import DecoderRNN, EncoderCNN
import onnxruntime as ort

Expand Down Expand Up @@ -163,6 +162,8 @@ def generate_caption(
return sentence

def export_onnx(self, encoder_output_path, decoder_output_path):
from torch.onnx import export, dynamo_export

self.load_models()

# Define a sample input image tensor (adjust input size as needed)
Expand Down

0 comments on commit 509edd2

Please sign in to comment.