Skip to content

Commit 3fe4ac6

Browse files
Removing unnecessary logging
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
1 parent 278c4d0 commit 3fe4ac6

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

terratorch/datasets/generic_pixel_wise_dataset.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def __getitem__(self, index: int) -> dict[str, Any]:
148148
if self.expand_temporal_dimension:
149149
image = rearrange(image, "(channels time) h w -> channels time h w", channels=len(self.output_bands))
150150
image = np.moveaxis(image, 0, -1)
151-
print(f"Image shape when entering __getitem__: {image.shape}")
151+
152152
if self.filter_indices:
153153
image = image[..., self.filter_indices]
154154
output = {
@@ -163,7 +163,7 @@ def __getitem__(self, index: int) -> dict[str, Any]:
163163
if self.transform:
164164
output = self.transform(**output)
165165
output["filename"] = self.image_files[index]
166-
print(f"Image shape after transform: {output['image'].shape}")
166+
167167
return output
168168

169169
def _load_file(self, path, nan_replace: int | float | None = None) -> xr.DataArray:

terratorch/io/file.py

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def load_from_file_or_attribute(value: list[float]|str):
6060
elif isinstance(value, str): # It can be the path for a file
6161
if os.path.isfile(value):
6262
try:
63-
print(value)
6463
content = np.genfromtxt(value).tolist()
6564
except:
6665
raise Exception(f"File must be txt, but received {value}")

terratorch/tasks/loss_handler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def compute_loss(
4040
If there are auxiliary heads, the main decode head is returned under the key "decode_head".
4141
All other heads are returned with the same key as their name.
4242
"""
43-
print(f"Model output: {model_output.output.shape}, Ground truth: {ground_truth.shape}")
43+
4444
loss = self._compute_loss(model_output.output, ground_truth, criterion)
4545
if not model_output.auxiliary_heads:
4646
return {"loss": loss}

terratorch/tasks/segmentation_tasks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def validation_step(self, batch: Any, batch_idx: int, dataloader_idx: int = 0) -
254254
x = batch["image"]
255255
y = batch["mask"]
256256
model_output: ModelOutput = self(x)
257-
print(f"Model output, validation: {model_output.output.shape}")
257+
258258
loss = self.val_loss_handler.compute_loss(model_output, y, self.criterion, self.aux_loss)
259259
self.val_loss_handler.log_loss(self.log, loss_dict=loss, batch_size=x.shape[0])
260260
y_hat_hard = to_segmentation_prediction(model_output)

0 commit comments

Comments
 (0)