I was able to run the current input_batch before calling the export operation. I ended up resolving this issue by making a dummy input a smaller, random tensor (calling torch.randn(1,3,224,224))and passing that into the export function in place of input_batch in my first post here.
However, I’m running into a different issue regarding the following 2 cells.
Cell #1:
# https://discuss.pytorch.org/t/when-i-export-deeplab-v3-using-torch-onnx-export-i-find-that-the-onnx-model-has-two-outputs-why/92401
dummy_input = torch.randn(1,3,224,224).to('cuda')
dummy_output = model(dummy_input)
input_names = [f"input {i}" for i in range(21)]

torch.onnx.export(model, dummy_input, '../models/deeplab_model_pytorch.onnx', verbose=True, input_names=['input_img'], output_names=['output_img'], opset_version=11)

Cell #2
import onnx
from onnx_tf.backend import prepare

model_onnx = onnx.load('../models/deeplab_model_pytorch.onnx')

tf_rep = prepare(model_onnx)
tf_rep.export_graph('../models/deeplab_model_tf.pb')

When tf_rep.export_graph runs in the 2nd cell, I get an error that reads

RuntimeError: Resize coordinate_transformation_mode=pytorch_half_pixel is not supported in Tensorflow.


I have read that changing my opset version to 10 in Cell #1 would remove the runtime error, but I’m unfortunately running into a different error where model is exported incorrectly between onnx and tensorflow. Would you have a suggestion on how to fix this?