Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mutex error #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ void run_mlp(){
Context ctx;

get_quant_mnist_ctx(ctx, input_x);
get_quant_mnist_ctx_s(ctx);
S_TENSOR pred_tensor = ctx.get("y_pred:0");
ctx.eval();

int pred_label = *(pred_tensor->read<int>(0, 0));
printf("Predicted label: %d", pred_label);
printf("Predicted label: %d\r\n", pred_label);

}

Expand Down
8 changes: 6 additions & 2 deletions mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@
"sd-clk": "D13",
"sd-cs": "D9"
}
}
}
},
"macros": [
"MBED_CONF_APP_MAIN_STACK_SIZE=8192"
]

}
3 changes: 3 additions & 0 deletions models/quant_mnist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ void get_quant_mnist_ctx(Context& ctx, Tensor* input_0) {
{ "Layer1/Relu_eightbit_quantized:0", "Layer1/Relu_eightbit_quantized:1", "Layer1/Relu_eightbit_quantized:2" });
ctx.eval();
}
}
void get_quant_mnist_ctx_s(Context& ctx) {
{
TensorIdxImporter t_import;
ctx.add(t_import.ubyte_import("/fs/constants/quant_mnist/Layer2_Variable_quint8_const_0.idx"),
Expand Down Expand Up @@ -301,6 +303,7 @@ void get_quant_mnist_ctx(Context& ctx, Tensor* input_0) {
{ "Layer2/Relu_eightbit_quantized:0", "Layer2/Relu_eightbit_quantized:1", "Layer2/Relu_eightbit_quantized:2" });
ctx.eval();
}

{
TensorIdxImporter t_import;
ctx.add(t_import.ubyte_import("/fs/constants/quant_mnist/OuputLayer_Variable_quint8_const_0.idx"),
Expand Down
1 change: 1 addition & 0 deletions models/quant_mnist.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
#define __MODELS_QUANT_MNIST_H
#include "context.hpp"
void get_quant_mnist_ctx(Context& ctx, Tensor* input_0);
void get_quant_mnist_ctx_s(Context& ctx);
#endif // __MODELS_QUANT_MNIST_H