Skip to content

Commit 6e4d4c8

Browse files
committed
include fsteam in libappbuilder.cpp, fix the issue of inference inception_v3 output postprocess after reshape output by default in qai_appbuilder
1 parent 073aa72 commit 6e4d4c8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

samples/python/inception_v3/inception_v3.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
if not MODEL_NAME in str(execution_ws):
3939
execution_ws = execution_ws / MODEL_NAME
4040

41-
model_dir = execution_ws / "models"
42-
model_path = model_dir / "{}.bin".format(MODEL_NAME)
43-
imagenet_classes_path = model_dir / IMAGENET_CLASSES_FILE
41+
model_dir = os.path.join(execution_ws, "models")
42+
model_path = os.path.join(model_dir, MODEL_NAME + ".bin")
43+
imagenet_classes_path = os.path.join(model_dir, IMAGENET_CLASSES_FILE)
4444

4545
####################################################################
4646

@@ -131,6 +131,7 @@ def Inference(input_image_path):
131131

132132
# show the Top 5 predictions for image
133133
output = torch.from_numpy(output_data)
134+
output = output.squeeze(0)
134135
probabilities = torch.softmax(output, dim=0)
135136
result=post_process(probabilities, output)
136137

src/LibAppBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <algorithm>
1919
#include <execution>
2020
#include <vector>
21-
21+
#include <fstream>
2222

2323
#include "BuildId.hpp"
2424
#include "DynamicLoadUtil.hpp"

0 commit comments

Comments
 (0)