PD-MeshNet icon indicating copy to clipboard operation
PD-MeshNet copied to clipboard

torch.nn.modules.module.ModuleAttributeError: 'BatchNorm' object has no attribute 'weight'

Open cravisjan97 opened this issue 4 years ago • 1 comments

I am training your UNet mesh segmenter model by running training_job_example_aliens_unet.py file and I get this error when I am trying to initialize the model. Is there a fix for this? Can I disable initialization and expect the same accuracy?

cravisjan97 avatar Jan 06 '21 18:01 cravisjan97

I am training your UNet mesh segmenter model by running training_job_example_aliens_unet.py file and I get this error when I am trying to initialize the model. Is there a fix for this? Can I disable initialization and expect the same accuracy?

Add statement hasattr(module, 'weight') before class_name.find('BatchNorm') != -1 in https://github.com/MIT-SPARK/PD-MeshNet/blob/e3f6c01ceff260778daf5fea66125413309e4399/pd_mesh_net/utils/models.py#L123 works for me. It could be changed to

elif hasattr(module, 'weight') and class_name.find('BatchNorm') != -1

Not sure if such changes will destroy the initialization of the network.

HaominJiang avatar Jan 17 '22 09:01 HaominJiang