New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLI]: wandb.Image breaks plt.imshow #6297
Comments
Looking into this a little bit, I suspect that the issue here might be the lazy loading of wandb/wandb/sdk/data_types/image.py Lines 274 to 277 in 00aed12
|
WandB Internal User commented: |
Hello @csparker247 ! Thank you for providing the detailed bug report! Since this seems to transient in nature, I was also unable to replicate this issue so would you be able to provide the They should be located in the wandb folder in the same directory as where the script was run. The wandb folder has folders formatted as run-DATETIME-ID associated with a single run. Could you retrieve the debug.log and debug-internal.log files from one of these folders specifically from the run that is having issues? |
Here you go! These are from a new run I just performed using the minimal example above. Note that I went through and redacted some of the sensitive paths, usernames, etc. |
Thank you very much! I will continue with making the bug report with this information. |
For reproducibility's sake, I'm running everything inside a Singularity (now Apptainer) container. The container definition file below is sufficient to reproduce the issue. You run my minimal example like so: sudo singularity build minimal.sif minimal.def
singularity run minimal.sif python minimal.py And the contents of
|
Thank you again! I have added this to current bug report. |
Describe the bug
I have a script where I log an image using
wandb.Image
then optionally use matplotlib to plot points on top of the same image. Since point plotting is optional, I import matplotlib inside my point plotting method. In practice, this looks like something like this:When I run this code on my laptop, this works just fine. However, when I run it on my university's computing cluster, I get
AttributeError: module 'PIL' has no attribute 'Image'
at theplt.imshow
call.I have no idea why this doesn't fail on all of my machines, but I've tracked the issue down to the import order for
matplotlib.pyplot
. I have no issues if I importpyplot
before usingwandb.Image
, but I get theAttributeError
if I import it afterwards. The following is a minimal code example which reproduces the issue:The obvious workaround is to just import
pyplot
at the start of my script, and I'll probably do that now, but I ultimately want to avoid this since point plotting is optional functionality.Additional Files
No response
Environment
WandB version: 0.15.10
OS: Ubuntu 22.04 (actually the Docker image nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04)
Python version: 3.10.12
Versions of relevant libraries:
I do not have the issue on my laptop with the following configuration:
WandB version: 0.15.10
OS: macOS Ventura 13.5.1 (22G90)
Python version: 3.10.13 (Homebrew)
matplotlib 3.8.0
Pillow 10.0.0
Additional Context
No response
The text was updated successfully, but these errors were encountered: