OpenPCDet icon indicating copy to clipboard operation
OpenPCDet copied to clipboard

Can we Export the model to standard Pytorch Model format ?

Open ammaryasirnaich opened this issue 3 years ago • 4 comments

I wanted to know if you can export the models to standard pytorch models ?

ammaryasirnaich avatar Aug 24 '22 18:08 ammaryasirnaich

I am not sure what the problem is. Current the model is saved by native torch.save() with explicit name-param pairs.

sshaoshuai avatar Sep 07 '22 11:09 sshaoshuai

Actually, I mean, can we traverse convolutional layers in the pre-trained model for Feature Maps as with the below code which can be done with a standard pytorch model

no_of_layers=0
conv_layers=[]
model_children=list(modelVGG.children())
 for child in model_children:
  print(type(child))
  if type(child)==nn.Conv2d:
    no_of_layers+=1
    conv_layers.append(child)
  elif type(child)==nn.Sequential:
    for layer in child.children():
      if type(layer)==nn.Conv2d:
        no_of_layers+=1
        conv_layers.append(layer)
print(no_of_layers)

ammaryasirnaich avatar Sep 07 '22 12:09 ammaryasirnaich

I am still not clear about your question. If you want to collect all convolution layers to a list, I think it is feasible if you are familiar with the model structure and know what type of layers you would like to collect.

sshaoshuai avatar Sep 07 '22 17:09 sshaoshuai

Yes, I want to collect all the convolution layers with trained weights. Really appreciate your reply, many thanks

ammaryasirnaich avatar Sep 08 '22 12:09 ammaryasirnaich

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 09 '22 02:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 24 '22 02:10 github-actions[bot]