cannot assign 'int' as child module 'precision' (torch.nn.Module or None expected) Error #6883
Answered
by
ananthsub
gaps013
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
I am trying to run trainer.fit with only models passed. However, I am getting the following error.
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 |
Beta Was this translation helpful? Give feedback.
Answered by
ananthsub
Apr 8, 2021
Replies: 2 comments 1 reply
-
Do you have any properties in your |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Borda
-
Having the same issue here. Seems to be no problem if I comment out model_connecter here |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you have any properties in your
Model
class namedprecision
?