# Images are not saved/logged

**URL:** <https://community.wandb.ai/t/images-are-not-saved-logged/3697>\
**Category:** W&B Help\
**Tags:** wandb\
**Created:** [January 13, 2023, 8:51pm UTC](https://community.wandb.ai/t/images-are-not-saved-logged/3697 "2023-01-13T20:51:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcheng](https://avatars.discourse-cdn.com/v4/letter/r/ecd19e/32.png) [@rcheng](https://community.wandb.ai/u/rcheng)\
**Post date:** [January 13, 2023, 8:51pm UTC](https://community.wandb.ai/t/images-are-not-saved-logged/3697/1 "2023-01-13T20:51:05Z")

</div>

Hi all,

I am using pytorch\_lightning.loggers.WandbLogger to log some intermediate results of my preprocessing but nothing (i.e. plots and images) are logged, except the key name.

Below is what I did:

```auto
wandb_logger = WandbLogger(..)
runner = Trainer(logger=wandb_logger,..)
data = VAEDataset(.., logger=runner.logger,..) # LightningDataModule
data.setup()

# in Dataset (in some preprocessing steps)
plt.figure(figsize=(10, 30))
plt.subplot(131), plt.imshow(orig_spec.detach(), cmap='gray')
plt.title('Input'), plt.xticks([]), plt.yticks([])
plt.subplot(132), plt.imshow(filtered_spec.squeeze().detach(), cmap='gray')
plt.title('FilteredSpec'), plt.xticks([]), plt.yticks([])
plt.subplot(133), plt.imshow(magnitude_spec.detach(), cmap='gray')
plt.title('MagnitudeSpec'), plt.xticks([]), plt.yticks([])
self.logger.experiment.log(
        {"HPFilter/Input_Filtered-_Magnitude-Spec": plt}
        )

# alternatively, I used wandb directly
wandb.log(
            {"HPFilter/FilteredSpec": wandb.Image(torch.flipud(filtered_spec).detach(), caption="FilteredSpec.png")}
        )

```

Both gave such empty panels:.

 ![wandb](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/2X/d/dd9cebdf46b068c21edbdbee92b5ec0fb5d8b9ac.png)

There is no subdir called “HPFilter” under “media” but when I checked `wandb-summary.json`:

```auto
..., "HPFilter/FilteredSpec": {"_type": "image-file", "sha256": "92bd05772ad44d6be9ef9fed80df00ff649e378abbcbb34f73d4082aceacedb0", "size": 86404, "path": "media/images/HPFilter/FilteredSpec_2_92bd05772ad44d6be9ef.png", "format": "png", "width": 128, "height": 256, "caption": "FilteredSpec_33150.png"}, ...

```

**Added:**  
To eliminate that the problem lies in my actual data, I tried the below to replace my intended logging:

```auto
    arr = torch.rand(256, 128)
    wandb.log(
            {"HPFilter/FilteredSpec": wandb.Image(torch.flipud(arr).detach().cpu().numpy(), caption=f"FilteredSpec.png")}
        )

```

It still behaved the same.

Many thanks in advance for any hints!

---

<div class="post-metadata">

**Author:** ![rcheng](https://avatars.discourse-cdn.com/v4/letter/r/ecd19e/32.png) [@rcheng](https://community.wandb.ai/u/rcheng)\
**Post date:** [January 16, 2023, 8:57am UTC](https://community.wandb.ai/t/images-are-not-saved-logged/3697/2 "2023-01-16T08:57:22Z")

</div>

Hi,

I solved this problem over the weekend.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [March 17, 2023, 8:57am UTC](https://community.wandb.ai/t/images-are-not-saved-logged/3697/3 "2023-03-17T08:57:38Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
