File size: 775 Bytes
c4f84a9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#!/bin/bash
# Loop through all .onnx files in the current directory
for model in ./*.onnx; do
# Exclude processing any files that already have a batch size in their name
if [[ ! $model =~ _batch[0-9]+\.onnx$ ]]; then
# Process for batch size 1
python fix_batch_dimension.py "$model" "${model%.onnx}_batch1.onnx" --batch_size 1
echo "Generated ${model%.onnx}_batch1.onnx"
# Process for batch size 2
python fix_batch_dimension.py "$model" "${model%.onnx}_batch2.onnx" --batch_size 2
echo "Generated ${model%.onnx}_batch2.onnx"
# Process for batch size 4
python fix_batch_dimension.py "$model" "${model%.onnx}_batch4.onnx" --batch_size 4
echo "Generated ${model%.onnx}_batch4.onnx"
fi
done
|