Skip to content

How can I use another PSPNet model with this? #59

Description

@jolags313

Hello, is there any way to use another PSPNet model with this? I found a newer and more accurate one, but when I change the parameter in semantic_cloud.yaml to point to it, I get the following error

Traceback (most recent call last):
  File "/home/conlab/ssv2_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 295, in <module>
    main(sys.argv)
  File "/home/conlab/ssv2_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 288, in main
    seg_cnn = SemanticCloud(gen_pcl = True)
  File "/home/conlab/ssv2_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 124, in __init__
    self.model.load_state_dict(convert_state_dict(state['model_state'])) # Remove 'module' from dictionary keys
KeyError: 'model_state'

Then, when I try to replace line 111 model_name ='pspnet' with model_name = {"model_state":"pspnet"}, I get another error

Traceback (most recent call last):
  File "/home/conlab/ssv2_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 296, in <module>
    main(sys.argv)
  File "/home/conlab/ssv2_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 289, in main
    seg_cnn = SemanticCloud(gen_pcl = True)
  File "/home/conlab/ssv2_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 123, in __init__
    self.model = get_model(model_name, self.n_classes, version = 'ade20k')
  File "/home/conlab/ssv2_ws/src/semantic_slam/semantic_cloud/include/ptsemseg/models/__init__.py", line 44, in get_model
    model = model(n_classes=n_classes)
TypeError: 'NoneType' object is not callable

Is there any way I can fix this? The model is the pspnet101 one pretrained on ADE20k I got from the Google Drive link here https://github.com/hszhao/semseg?tab=readme-ov-file

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions