magicleap/Atlas

About inference.py

MorchelPeng opened this issue · 2 comments

I run the inference.py and have an error:

Traceback (most recent call last):
File "inference.py", line 149, in
main()
File "inference.py", line 127, in main
model = VoxelNet.load_from_checkpoint(args.model)
File "/home/mxp/anaconda3/lib/python3.7/site-packages/pytorch_lightning/core/saving.py", line 156, in load_from_checkpoint
model = cls._load_model_state(checkpoint, strict=strict, kwargs)
File "/home/mxp/anaconda3/lib/python3.7/site-packages/pytorch_lightning/core/saving.py", line 198, in _load_model_state
model = cls(
_cls_kwargs)
File "/home/mxp/atlas/Atlas-master/atlas/model.py", line 93, in init
self.hparams = hparams
File "/home/mxp/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1178, in setattr
object.setattr(self, name, value)
AttributeError: can't set attribute

parameters are not passed in correctly

Was facing the same issue. Replacing self.hparams = hparams with self.save_hyperparameters(hparams) solved it

self.hparams = hparams