Skip to content

Commit ce6ee04

Browse files
Changed print statements to log statements.
1 parent 691a94a commit ce6ee04

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

src/MAGIST/NLP/SelfAttention.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ def print_results(self, attention_weights, threshold, vectorized_text, show_only
210210
stat = "Not"
211211
if show_only_important:
212212
if attention_weights[i] >= threshold:
213-
print(f"{attention_weights[i]:.2f}, {self.vectorize_layer.get_vocabulary()[vectorized_text[i]]}, {stat}")
213+
self.log.info(f"{attention_weights[i]:.2f}, {self.vectorize_layer.get_vocabulary()[vectorized_text[i]]}, {stat}")
214214
else:
215-
print(
215+
self.log.info(
216216
f"{attention_weights[i]:.2f}, {self.vectorize_layer.get_vocabulary()[vectorized_text[i]]}, {stat}")
217217

218218
def __call__(self, input_text):

src/MAGIST/TaskManagment/ThreadedQueue.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def search_results(self, query):
116116
"""
117117

118118
r = self.function_returns
119-
print(r)
120119
r = np.array(r)
121120
r = r[r[:, 0] == query]
122121
r = np.squeeze(r)

src/MAGIST/Utils/WebScraper/google.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __my_progressbar(self, url, progress):
6969
:param progress: The percentage of progress in downloading the file.
7070
:return: None
7171
"""
72-
print(url + ' ' + str(progress) + '%')
72+
self.log.info(url + ' ' + str(progress) + '%')
7373

7474
# t = tqdm(total=100, desc=url)
7575
# t.update(progress)

src/MAGIST/Vision/DetectionDataManager/image_slicer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ def resizer(self, size, base_path):
6161

6262
except (FileNotFoundError, UnidentifiedImageError, ValueError) as error:
6363
if error == UnidentifiedImageError:
64-
print("Unidentified image: {}".format(image_path))
64+
self.log.warning("Unidentified image: {}".format(image_path))
6565
if error == FileNotFoundError:
66-
print("Image Not Found: {}".format(image_path))
66+
self.log.warning("Image Not Found: {}".format(image_path))
6767
if error == ValueError:
68-
print("Image Type Not Supported: {}".format(image_path))
68+
self.log.warning("Image Type Not Supported: {}".format(image_path))
6969

7070
self.log.info("Resized {} files in {}".format(counter, base_path))
7171

src/MAGIST/Vision/FullySupervisedModels/MAGIST_Lite_Detector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def train(self):
339339

340340
if ((int(self.ckpt.step) - 1) % self.batch_size) == 0:
341341
save_path = self.manager.save()
342-
print("Saved checkpoint for step {}: {}".format(int(self.ckpt.step) - 1, save_path))
342+
self.log.info("Saved checkpoint for step {}: {}".format(int(self.ckpt.step) - 1, save_path))
343343

344344
self.epoch_arr.append(epoch + 1)
345345
self.train_loss_arr.append(self.train_loss.result())
@@ -355,7 +355,7 @@ def train(self):
355355
self.callbacks.on_train_end()
356356

357357
for i in range(len(self.epoch_arr)):
358-
print(
358+
self.log.info(
359359
f'Epoch {self.epoch_arr[i]}, '
360360
f'Loss: {self.train_loss_arr[i]}, '
361361
f'Accuracy: {self.train_accuracy_arr[i]}, '

0 commit comments

Comments
 (0)