lanpa / tensorboardX

tensorboard for pytorch (and chainer, mxnet, numpy, ...)
https://tensorboardx.readthedocs.io/en/latest/tensorboard.html
MIT License
7.87k stars 863 forks source link

add_graph does not work with 3D image, such as 3D MRI #346

Open anbai106 opened 5 years ago

anbai106 commented 5 years ago

Hi,

Thanks for your work to bridge tensorboard and pytorch.

It works well for monitering the loss and accuracy during the training. However when I wanna save the model as a graph, it gave me error (It worked for 2D image, like image in ImageNet). Here are my code to save the model:  writer_train.add_graph(best_autodecoder, example_batch) The shape of my input data: _examplebatch.shape = [1, 1, 51, 51, 51] If I fed the example batch data directly into my autoencoder, it worked without error. However, when I save my graph, here is the error:

ValueError: Auto nesting doesn't know how to process an input object of type int. Accepted types: Tensors, or lists/tuples of them

I debugged it, error was from my autoencoder code, but I did not understand if I fed it directly to my AE, it worked....

Thanks in advance for your help

Hao

lanpa commented 5 years ago

Can you share your model? Is there any custom layer used?

anbai106 commented 5 years ago

@lanpa Ok, I see. Yes, in my auto encoder, I used customized layers, like transConvNet layer… So basically, it does not guarantee for this kind of layers?