How to solve ModuleNotFoundError: No module named 'torch.utils.tensorboard'

username: Clem_Grt
cooked: <p>Greetings,<br>
I’m trying to carry out the Tutorial : Visualizing Models, Data, and Training with TensorBoard</p>
<p>But in chapter 1.tensorboard setup I have an issue with the line<br>
“from torch.utils.tensorboard import SummaryWriter” which gives the error mentionned above.</p>
<p>I tried to update both Pytorch and tensorboard (Pip says that tensorboard is already installed…)</p>
<p>Does any of you have a solution to this problem ?<br>
Thanks</p>

username: albanD
cooked: <p>Hi,</p>
<p>What is the value of <code>torch.__version__</code>?</p>

username: Clem_Grt
cooked: <p>The version is 0.4.0</p>
<p>This is what Pip says <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:">pip search torch<br>
torch-vision (0.1.6.dev0)             - image and video datasets and models for torch deep learning<br>
torch (1.3.0.post2)                   - Tensors and Dynamic neural networks in Python with strong GPU acceleration<br>
INSTALLED: 1.3.0<br>
LATEST:    1.3.0.post2<br>
deepctr-torch (0.1.3)                 - Easy-to-use,Modular and Extendible package of deep learning based CTR(Click<br>
Through Rate) prediction models with PyTorch<br>
fcd-torch (1.0.7)                     - Fréchet ChemNet Distance on PyTorch<br>
torch-layers (0.1.2)                  -<br>
torch-inspect (0.0.3)                 - Utility functions that prints a summary of a model.<br>
torch-geometric (1.3.2)               - Geometric Deep Learning Extension Library for PyTorch<br>
torch-tagger (0.0.61)                 - NLP tool<br>
torch-ssd (1.2.0)                     - High quality, fast, modular reference implementation of SSD in PyTorch<br>
torch-buddy (0.0.5)                   - pytorch toolkit<br>
torch-sparse (0.4.3)                  - PyTorch Extension Library of Optimized Autograd Sparse Matrix Operations<br>
torch-radiate (0.0.1)                 - Automatic deep learning research report generator<br>
torch-testing (0.0.2)                 - A collection of assertion methods to compare PyTorch Tensors in tests<br>
torch-scatter (1.3.2)                 - PyTorch Extension Library of Optimized Scatter Operations<br>
torch-encoding (1.0.1)                - PyTorch Encoding Package<br>
bayes-torch (0.0.4)                   - A light weight bayes inference framework based on pytorch.<br>
torch-gpipe (0.0.0a0)                 -<br>
torch-cluster (1.4.5)                 - PyTorch Extension Library of Optimized Graph Cluster Algorithms<br>
torch-hypothesis (0.1.1)              - Generate pytorch data structures for the hypothesis testing library.<br>
torch-trainer (0.1)                   - Bare bones PyTorch training utility<br>
torch-tools (0.0.11)                  - A library of helpers to train, evaluate and visualize deep nets with PyTorch.<br>
torch-ac (1.1.0)                      -<br>
torch-light (1.0.0)                   - A mini framework for pytorch<br>
torch-transformer (0.18.1)            - Transformer implemented in PyTorch<br>
torch-salad (0.2.1a0)                 - Semi-supervised Adaptive Learning Across Domains<br>
torch-mtcnn (0.0.7)                   - Implementation of MTCNN using Pytorch.<br>
torch-lp (0.1.3)                      - quantization simulation tools for Pytorch<br>
torch-scope (0.5.4)                   - A Toolkit for Training, Tracking and Saving PyTorch Models<br>
torch-stft (0.1.4)                    - An STFT/iSTFT for PyTorch<br>
gluoncv-torch (0.0.3)                 - MXNet Gluon CV Toolkit<br>
torch-flame (0.1.0)                   - A deep learning utility library for PyTorch<br>
torch-helpers (0.4.6)                 - A set of helper functions for pyTorch<br>
k-torch (0.1.0)                       - A Keras-like wrapper for PyTorch<br>
my-torch (0.0.1)                      - A transparent boilerplate + bag of tricks to ease my (yours?) (our?) PyTorch<br>
dev time.<br>
torch-unique (1.0.3)                  - Optimized PyTorch Unique Operation<br>
torch-stethoscope (0.0.1)             - Automatic deep learning research report generator<br>
rpi3.torch (0.1.0)                    - PyTorch in Raspberry Pi3 B, py35, armv7l<br>
torch-es (0.0.1)                      - Double Seasonal Exponential Smoothing using PyTorch + ES-RNN capabilities on<br>
top<br>
torch-utils (0.1.2)                   - Common Utils for PyTorch<br>
torch-eunn (0.2.0)                    - An Efficient Unitary Neural Network implementation for PyTorch<br>
torch-dct (0.1.5)                     - Discrete Cosine Transform (DCT) for pytorch<br>
torch-raspi (0.4.0)                   - PyTorch for Raspberry Pi 3B armv7l<br>
torch-bincount (0.1.1)                - Optimized PyTorch BinCount Operation<br>
torch-crypto (0.1.1)                  - Command-line Cryptanalysis<br>
rlgarage-torch (0.1.0)                -<br>
torch-kerosene (0.1.0)                - Deep Learning framework for fast and clean research development with Pytorch<br>
torchlight (0.0.1)                    - Torch Light<br>
torch-position-embedding (0.7.1)      - Position embedding implemented in PyTorch<br>
torch-basic-models (0.2.8)            - Basic Models for PyTorch, with Unified Interface<br>
torch-spline-conv (1.1.1)             - Implementation of the Spline-Based Convolution Operator of SplineCNN in<br>
PyTorch<br>
torch-gpt-2 (0.3.0)                   - GPT-2 implemented in PyTorch<br>
torch-layer-normalization (0.10.2)    - Layer normalization implemented in PyTorch<br>
torch-lr-scheduler (0.0.6)            - PyTorch Optimizer Lr Scheduler<br>
torch-text-classifier (0.0.58)        - NLP tool<br>
torch-baidu-ctc (0.3.0)               - PyTorch bindings for Baidu Warp-CTC<br>
torch-model-state (0.0.9)             - PyTorch Model State Save &amp; Load<br>
torch-parameter-groups (0.0.5.post1)  - Group PyTorch Parameters according to Rules<br>
torch-lr-finder (0.0.1)               - Pytorch implementation of the learning rate range test<br>
torch-embed-sim (0.3.2)               - Embedding similarity implemented in PyTorch<br>
ergo-pytorch (1.1.1)                  - making torch even better.<br>
torchrs (0.2.3)                       - Torch dependencies management tool<br>
lutorpy (1.3.7)                       - Python wrapper for torch and Lua/LuaJIT<br>
torch-multi-head-attention (0.15.1)   - Multi-head attention implemented in PyTorch<br>
torchure (0.0.14)                     - A collection of small functions that supplements torch functionality<br>
torchfun (1.0.82)                     - A collection of functions/classes that supplements torch functionality.<br>
visdom (0.1.8.9)                      - A tool for visualizing live, rich data for Torch and Numpy<br>
torchvision (0.4.1.post2)             - image and video datasets and models for torch deep learning<br>
INSTALLED: 0.4.1<br>
LATEST:    0.4.1.post2<br>
torchcv (0.0.2)                       - image and video datasets and models for torch deep learning<br>
tnet (0.0.1a1)                        - Torch and torchnet like library for building and training neural networks in<br>
Theano<br>
pystencils-autodiff (0.2.2)           - Automatic differentiation and generation of Torch/Tensorflow operations with<br>
pystencils (<a href="https://i10git.cs.fau.de/pycodegen/pystencils" rel="nofollow noopener">https://i10git.cs.fau.de/pycodegen/pystencils</a>)</p>

username: albanD
cooked: <p>Hi,</p>
<p>tensorboard has been added recently. So you would need to upgrade your pytorch version to have access to it.</p>

username: Clem_Grt
cooked: <p>I’ve just upgraded it (even though I thought I had already done it)<br>
now version is 1.0.1 and it still doesn’t work…<br>
I used “conda update pytorch” to upgrade.</p>

username: albanD
cooked: <p>You might want to upgrade your conda as well. The latest version is 1.3.<br>
Some of our dependencies require a recent conda, so upgrading conda should let you upgrade pytorch to 1.3.</p>

username: Clem_Grt
cooked: <p>Sometimes I feel like development is all about updating stuffs… lol<br>
I’ll do that thank you very much!</p>

username: Clem_Grt
cooked: <p>My mistake, I updated it with Pip</p>

username: Clem_Grt
cooked: <p>Everything is up to date now :<br>
tensorboard       2.0.0<br>
tensorboardX      1.5<br>
torch             1.3.0<br>
torchtext         0.3.1<br>
torchvision       0.4.1</p>
<p>yet I’m still facing the same problem.<br>
(I’ve also restarted the computer.)</p>
<p>Could it be possible that I have 2 versions of PyTorch on my computer : 1 installed via Pip and 1 via conda ?</p>

username: albanD
cooked: <p>Hi,</p>
<p>Yes it’s possible. If you’re inside a conda environment. I would advise not to use pip unless a conda package is not available.<br>
You can <code>pip uninstall torch</code> and <code>conda uninstall torch</code> (not sure if it’s the right conda command to uninstall). And run these until you don’t have pytorch. Then install just one.</p>

username: Brando_Miranda
cooked: <p>what is the latest version of pytorch that does not show this error?</p>

username: ptrblck
cooked: <p>The latest stable version is <code>1.4</code> and you can import it as <code>from torch.utils import tensorboard</code>.</p>

username: Brando_Miranda
cooked: <p>sorry I meant what is the earliest version that supports it.</p>