Meshes not showing in tensorboard

Hi,

I am using pytorch 1.3.1 and tf-nighty (as per the pytorch documentation).
I have tried the example code for add_mesh to add a mesh to tensorboard

from torch.utils.tensorboard import SummaryWriter
vertices_tensor = torch.as_tensor([
    [1, 1, 1],
    [-1, -1, 1],
    [1, -1, -1],
    [-1, 1, -1],
], dtype=torch.float).unsqueeze(0)
colors_tensor = torch.as_tensor([
    [255, 0, 0],
    [0, 255, 0],
    [0, 0, 255],
    [255, 0, 255],
], dtype=torch.int).unsqueeze(0)
faces_tensor = torch.as_tensor([
    [0, 2, 3],
    [0, 3, 1],
    [0, 1, 2],
    [1, 3, 2],
], dtype=torch.int).unsqueeze(0)

writer = SummaryWriter()
writer.add_mesh('my_mesh', vertices=vertices_tensor, colors=colors_tensor, faces=faces_tensor)

writer.close()

This is what I get
image
I can’t find any solutions online to this issue.

  • Does anyone have any suggestion to get this to work?
  • Has anyone managed to get this to work?

I have raised an issue on github #30561 and it was suggested to raise it here.

Thanks

Adam

I tried to reproduce the issue using your code, but I get some images:

I’m using tensorboard 2.0.2 with PyTorch 1.4.0.dev20191109

Thanks. I’ll try those versions and see if it works.

I have tried with the following conda environment with no success.

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
absl-py                   0.8.1                    py36_0  
astor                     0.8.0                    pypi_0    pypi
blas                      1.0                         mkl  
c-ares                    1.15.0            h7b6447c_1001  
ca-certificates           2019.10.16                    0  
cachetools                3.1.1                    pypi_0    pypi
certifi                   2019.9.11                py36_0  
cffi                      1.13.2           py36h2e261b9_0  
chardet                   3.0.4                    pypi_0    pypi
cudatoolkit               10.1.243             h6bb024c_0  
freetype                  2.9.1                h8a8886c_1  
gast                      0.2.2                    pypi_0    pypi
google-auth               1.7.1                    pypi_0    pypi
google-auth-oauthlib      0.4.1                    pypi_0    pypi
google-pasta              0.1.8                    pypi_0    pypi
grpcio                    1.25.0                   pypi_0    pypi
h5py                      2.10.0                   pypi_0    pypi
idna                      2.8                      pypi_0    pypi
intel-openmp              2019.4                      243  
jpeg                      9b                   h024ee3a_2  
keras-applications        1.0.8                    pypi_0    pypi
keras-preprocessing       1.1.0                    pypi_0    pypi
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 9.1.0                hdf63c60_0  
libgfortran-ng            7.3.0                hdf63c60_0  
libpng                    1.6.37               hbc83047_0  
libprotobuf               3.10.1               hd408876_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
libtiff                   4.1.0                h2733197_0  
markdown                  3.1.1                    py36_0  
mkl                       2019.4                      243  
mkl-service               2.3.0            py36he904b0f_0  
mkl_fft                   1.0.15           py36ha843d7b_0  
mkl_random                1.1.0            py36hd6b4f25_0  
ncurses                   6.1                  he6710b0_1  
ninja                     1.9.0            py36hfd86e86_0  
numpy                     1.17.4           py36hc1035e2_0  
numpy-base                1.17.4           py36hde5b4d6_0  
oauthlib                  3.1.0                    pypi_0    pypi
olefile                   0.46                       py_0  
openssl                   1.1.1d               h7b6447c_3  
opt-einsum                3.1.0                    pypi_0    pypi
pillow                    6.2.1            py36h34e0f95_0  
pip                       19.3.1                   py36_0  
protobuf                  3.10.1           py36he6710b0_0  
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.7                    pypi_0    pypi
pycparser                 2.19                       py_0  
python                    3.6.9                h265db76_0  
pytorch                   1.4.0.dev20191127 py3.6_cuda10.1.243_cudnn7.6.3_0    pytorch-nightly
readline                  7.0                  h7b6447c_5  
requests                  2.22.0                   pypi_0    pypi
requests-oauthlib         1.3.0                    pypi_0    pypi
rsa                       4.0                      pypi_0    pypi
scipy                     1.3.3                    pypi_0    pypi
setuptools                42.0.1                   py36_0  
six                       1.13.0                   py36_0  
sqlite                    3.30.1               h7b6447c_0  
tensorboard               2.0.2                    pypi_0    pypi
tensorflow-estimator      2.0.1                    pypi_0    pypi
tensorflow-gpu            2.0.0                    pypi_0    pypi
tensorflow-graphics-gpu   1.0.0                    pypi_0    pypi
termcolor                 1.1.0                    pypi_0    pypi
tk                        8.6.8                hbc83047_0  
torchvision               0.5.0.dev20191127      py36_cu101    pytorch-nightly
urllib3                   1.25.7                   pypi_0    pypi
werkzeug                  0.16.0                     py_0  
wheel                     0.33.6                   py36_0  
wrapt                     1.11.2                   pypi_0    pypi
xz                        5.2.4                h14c3975_4  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.3.7                h0b5b093_0  

I have also ran inspect

$ tensorboard --logdir tests --port 0 --inspect
======================================================================
Processing event files... (this can take a few minutes)
======================================================================

Found event files in:
tests

These tags are in tests:
audio -
histograms -
images -
scalars -
tensor
   my_mesh_COLOR
   my_mesh_FACE
   my_mesh_VERTEX
======================================================================

Event statistics for tests:
audio -
graph -
histograms -
images -
scalars -
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
tensor
   first_step           0
   last_step            0
   max_step             0
   min_step             0
   num_steps            1
   outoforder_steps     []
======================================================================

I still don’t get a mesh rendered.

I have also tried with pytorch 1.3.1 with tensorboard 2.0.2 also with no luck.

I’m using firefox to view the tensorboard.

The issue was firefox. It works with chrome.

I have the same issue. The example code works for me fine. But I have a bigger mesh from Trimesh. Tensorboard shows a blank white screen.