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

Fixing bug in readLabels (utils)

parent a39ad20d
No related branches found
No related tags found
No related merge requests found
...@@ -209,7 +209,7 @@ void* readInputTensor(const char* file_name, int data_type, int dim1_size, int d ...@@ -209,7 +209,7 @@ void* readInputTensor(const char* file_name, int data_type, int dim1_size, int d
dim3_size, dim4_size); dim3_size, dim4_size);
initTensorData(input, tensor_data, size_in_bytes); initTensorData(input, tensor_data, size_in_bytes);
compareValues(input, tensor_data, num_elems); //compareValues(input, tensor_data, num_elems);
return input; return input;
} }
...@@ -249,7 +249,7 @@ struct Tensor* readTrainedWeights(const char* file_name, int data_type, int dim1 ...@@ -249,7 +249,7 @@ struct Tensor* readTrainedWeights(const char* file_name, int data_type, int dim1
uint8_t* readLabels(const char* labels_file, int num_labels){ uint8_t* readLabels(const char* labels_file, int num_labels){
int file_header_size = 8; //int file_header_size = 8;
uint8_t* labels = (uint8_t*) malloc(sizeof(uint8_t) * num_labels); uint8_t* labels = (uint8_t*) malloc(sizeof(uint8_t) * num_labels);
FILE* file = fopen(labels_file, "rb"); FILE* file = fopen(labels_file, "rb");
if(file == NULL){ if(file == NULL){
...@@ -257,9 +257,9 @@ uint8_t* readLabels(const char* labels_file, int num_labels){ ...@@ -257,9 +257,9 @@ uint8_t* readLabels(const char* labels_file, int num_labels){
abort(); abort();
} }
fseek(file, file_header_size, SEEK_CUR); // Skipping the file header //fseek(file, file_header_size, SEEK_CUR); // Skipping the file header
size_t bytes_read = fread(labels, 1, sizeof(uint8_t) * num_labels, file); size_t bytes_read = fread(labels, 1, sizeof(uint8_t) * num_labels, file);
printf("--labels bytes_read = %zu \n", bytes_read); printf("*Label bytes_read = %zu \n", bytes_read);
return labels; return labels;
} }
......
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