longcw / pytorch2caffe

Convert PyTorch model to Caffemodel
541 stars 151 forks source link

how can i get all the parameters of one layer #12

Open GeorgeBohw opened 6 years ago

GeorgeBohw commented 6 years ago

Now i use "pytorch2caffe" to convert to my model. When it convert "torch.cat",it tell me the message as following: AttributeError: 'CatBackward' object has no attribute 'dim' I check it in pytorch ,actually it has this parameter: torch.cat(seq, dim=0, out=None)

So I wonder what kind of parameters "output_var.grad_fn" take....

In pytorch2prototxt(),for the convolution layer,you can get parameters in this way: func.padding[0] func.stride[0]

If I want to see all the parameters of convolution layer,how should i do?

Itry "print func",it's not right;If try "print func.padding[0]",it's ok!

Now for a new layer which i don't know what kind of parameters it takes,how can i print all the parameters?

Thanks for it.