Skip to content
Snippets Groups Projects
Commit 2781c576 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

Fixing ResNet18 TensorRT sources

parent 57fe2f4b
No related branches found
No related tags found
No related merge requests found
......@@ -7,13 +7,12 @@ int main() {
llvm_hpvm_initTensorRt(0);
std::string dir_prefix =
model_params_path + std::string("/resnet18_cifar10/");
std::string input_path = dir_prefix + std::string("input.bin");
// void* input = readTrainedWeights(input_path.c_str(), 0,
// batch_size,3,32,32);
std::string labels_path = dir_prefix + std::string("labels.bin");
// uint8_t* labels = readLabels(labels_path.c_str(), batch_size);
std::string dir_prefix = model_params_path + std::string("/resnet18_cifar10/");
std::string input_path = dir_prefix + std::string("test_input.bin");
std::string labels_path = dir_prefix + std::string("test_labels.bin");
std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin");
void *conv2d_1_w =
readTrainedWeights(conv2d_1_w_path.c_str(), 0, 16, 3, 3, 3);
......@@ -237,9 +236,9 @@ int main() {
void *var_95 = tensorHalfAdd(var_94, dense_1_b);
void *var_96 = tensorSoftmax(var_95);
uint8_t *labels = readLabelsBatch(labels_path.c_str(), start, end);
uint32_t *labels = readLabelsBatch3(labels_path.c_str(), start, end);
float accuracy = computeAccuracy2(labels, batch_size, var_96);
float accuracy = computeAccuracy3(labels, var_96);
final_accuracy += accuracy;
freeBatchMemory();
......
#include "../../tensor_runtime/include/tensor_runtime.h"
#include "../include/utils.h"
#include "../../../tensor_runtime/include/tensor_runtime.h"
#include "../../include/utils.h"
int main() {
llvm_hpvm_initTensorRt(1);
llvm_hpvm_initTensorRt(0);
std::string dir_prefix =
model_params_path + std::string("/resnet18_cifar10/");
std::string input_path = dir_prefix + std::string("input.bin");
// void* input = readTrainedWeights(input_path.c_str(), 0,
// batch_size,3,32,32);
std::string labels_path = dir_prefix + std::string("labels.bin");
// uint8_t* labels = readLabels(labels_path.c_str(), batch_size);
std::string dir_prefix = model_params_path + std::string("/resnet18_cifar10/");
std::string input_path = dir_prefix + std::string("test_input.bin");
std::string labels_path = dir_prefix + std::string("test_labels.bin");
std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin");
void *conv2d_1_w =
readTrainedWeights(conv2d_1_w_path.c_str(), 0, 16, 3, 3, 3);
......@@ -237,9 +236,9 @@ int main() {
void *var_95 = tensorAdd(var_94, dense_1_b);
void *var_96 = tensorSoftmax(var_95);
uint8_t *labels = readLabelsBatch(labels_path.c_str(), start, end);
uint32_t *labels = readLabelsBatch3(labels_path.c_str(), start, end);
float accuracy = computeAccuracy2(labels, batch_size, var_96);
float accuracy = computeAccuracy3(labels, var_96);
final_accuracy += accuracy;
freeBatchMemory();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment