Open lw0210 opened 2 years ago
Hi, I also met this problem. It seems related to the newer version of pytorch-lightning. I solved this by replacing self.hparams = hparams
with self.save_hyperparameters(hparams)
. In my case, I used pytorch-lightning 1.5.0, and PyTorch 1.10.
Dear, when I run on the sample scene use: python inference.py --model results/release/semseg/final.ckpt --scenes METAROOT/sample/sample1/info.json
it show that: 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/liwei/.conda/envs/atlas/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/liwei/.conda/envs/atlas/lib/python3.7/site-packages/pytorch_lightning/core/saving.py", line 198, in _load_model_state
model = cls(_cls_kwargs)
File "/home/liwei/github/Atlas/atlas/model.py", line 93, in init
self.hparams = hparams
File "/home/liwei/.conda/envs/atlas/lib/python3.7/site-packages/torch/nn/modules/module.py", line 826, in setattr
object.setattr(self, name, value)
AttributeError: can't set attribute
What can I do can solve the problem?