cannot assign 'int' as child module 'precision' (torch.nn.Module or None expected) Error
I am trying to run trainer.fit with only models passed. However, I am getting the following error.
Traceback (most recent call last):
  File "train.py", line 116, in <module>
    main_func(args)
  File "train.py", line 55, in main_func
    trainer.fit(model, train_dataloader=train_dataloader, val_dataloaders=val_dataloader)
  File "/netscratch/gsingh/EVN/Anaconda/envs/lighting_neptune/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 443, in fit
    self.model_connector.copy_trainer_model_properties(model)
  File "/netscratch/gsingh/EVN/Anaconda/envs/lighting_neptune/lib/python3.8/site-packages/pytorch_lightning/trainer/connectors/model_connector.py", line 39, in copy_trainer_model_properties
    m.precision = self.trainer.precision
  File "/netscratch/gsingh/EVN/Anaconda/envs/lighting_neptune/lib/python3.8/site-packages/torch/nn/modules/module.py", line 982, in __setattr__
    raise TypeError("cannot assign '{}' as child module '{}' "
TypeError: cannot assign 'int' as child module 'precision' (torch.nn.Module or None expected)

I am unable to figure this out. Any help would be appreciated
    trainer = Trainer(
        logger=logger, resume_from_checkpoint=args.resume_from_checkpoint, max_epochs=args.num_epochs,
        accumulate_grad_batches=args.gradient_accumulation_steps, 
        default_root_dir=args.experiment_path, checkpoint_callback=ckpt, num_sanity_val_steps=args.num_sanity_val_steps, 
        gradient_clip_val=args.gradient_clip_val, gpus=1, auto_select_gpus=True, sync_batchnorm=args.sync_batchnorm
    )
                        
    criterion = torch.nn.CrossEntropyLoss()
    criterion_val = torch.nn.CrossEntropyLoss()
    
    model = Model(args, tr_dl=train_dataloader, val_dl=val_dataloader, test_dl=test_dataloader, criterion=criterion, criterion_val=criterion_val)
    trainer.fit(model)
Here precision value is the default.
Thank You
Do you have any properties in your Model class named precision ?