tensorboardX 2.3 imports Pillow and PyTorch despite not depending on them
See original GitHub issueDescribe the bug
tensorboardX only has NumPy and Protobuf listed as dependencies, but if you try to import it, it tries to import PIL
and torch
as well.
This is a regression from 2.2.
Minimal runnable code to reproduce the behavior
$ python3 -mvenv /tmp/venv
$ /tmp/venv/bin/pip install -U pip
[...]
Successfully installed pip-21.1.3
$ /tmp/venv/bin/pip install tensorboardX==2.3
[...]
Successfully installed numpy-1.19.5 protobuf-3.17.3 six-1.16.0 tensorboardX-2.3
$ /tmp/venv/bin/python -c 'import tensorboardX'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/venv/lib/python3.6/site-packages/tensorboardX/__init__.py", line 5, in <module>
from .torchvis import TorchVis
File "/tmp/venv/lib/python3.6/site-packages/tensorboardX/torchvis.py", line 11, in <module>
from .writer import SummaryWriter
File "/tmp/venv/lib/python3.6/site-packages/tensorboardX/writer.py", line 17, in <module>
from .comet_utils import CometLogger
File "/tmp/venv/lib/python3.6/site-packages/tensorboardX/comet_utils.py", line 4, in <module>
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
(If you install Pillow, the same error happens with import torch
in the same module.)
Expected behavior The import should succeed. All functionality that doesn’t depend on Pillow or PyTorch should work.
Screenshots N/A
Environment
What is the result of
pip list|grep -E "torch|proto|tensor"
If the version is too old, please try to update first.
protobuf 3.17.3
tensorboardX 2.3
Python environment I’m using Python 3.6.9 from the Ubuntu 18.04 repositories.
Additional context N/A
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
tensorboardX 2.3 imports Pillow and PyTorch despite not depending ...
Describe the bug tensorboardX only has NumPy and Protobuf listed as dependencies, but if you try to import it, it tries to import...
Read more >Cannot install any version of torchvision newer than 0.2.2 with ...
Bug Issue #3207 has cropped up again for pytorch 1.9.0 Cannot install any version of torchvision newer than 0.2.2 with opencv for python...
Read more >torch.utils.tensorboard — PyTorch 1.13 documentation
The SummaryWriter class provides a high-level API to create an event file in a given directory and add summaries and events to it....
Read more >Deep Learning with PyTorch
Can you import torch? What version of PyTorch do you get? c. What is the result of torch.cuda.is_available()? Does it match your expectation...
Read more >PyTorch Forecasting for Time Series Forecasting | Kaggle
Deep Learning may have taken the front seat in computer vision and language processing tasks but ,even though having outperformed the traditional methods...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1, this introduces a large dependency regression for our ecosystem too!
This has caused a problem/minor annoyance for my company’s project. We are now forced to install pytorch and allocate more ram on our containers despite not needing either for anything else.