Closed ZihanZhang0 closed 1 year ago
As written in the document (also docstring), the first input should be pytorch model. In your example, it seems that you are passing output of model, which is a tensor, rather than the model itself. Assuming that X
and TE
are the inputs for your model, the correct way is the following
model_graph = draw_graph(model, input_data=(X, TE))
model_graph.visual_graph
It works! Thank you so much!
Hi, I'm trying to draw the graph of GMAN model. The source code link is https://github.com/VincLee8188/GMAN-PyTorch I added the
model_graph = draw_graph(model(X,TE), input_size=(1,12*325)) model_graph.visual_graph
in the train.py file since the input of the model is calculated in the functiontrain
. I got a problem when running the line:model_graph = draw_graph, input_size)
It throws that kind of error:
As model.training is boolean represents whether this module is in training or evaluation mode. I ran the line of
model_graph
aftermodel.train()
. Iprint(model.training)
before the line and got True.Thanks in advance for your valuable helps.