Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jolags313 opened this issue Mar 12, 2024 · 0 comments
Open

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

jolags313 opened this issue Mar 12, 2024 · 0 comments

Comments

@jolags313
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant