floatlazer / semantic_slam

Real time semantic slam in ROS with a hand held RGB-D camera
GNU General Public License v3.0
612 stars 177 forks source link

How to change into my own PSPnet model? #29

Open zanezfx opened 3 years ago

zanezfx commented 3 years ago

I created a dataset with some certain types of objects, and I trained a new PSPnet model on that dataset. How can I replace your model with mine? Thank you!

codieboomboom commented 3 years ago

Have you taken a look at the source code of the node that generate the semantic image ?

ahmadkh1995 commented 3 years ago

If you already have your own model , you just need to modify this file; semantic_slam/semantic_slam/params/semantic_cloud.yaml

and substitute this line; model_path: "/home/interns/xuan/models/pspnet_50_ade20k.pth"

frankSARU commented 2 years ago

I'm trying to use my own model too and I have trained a PSPnet model with ADE20K dataset. But the console give me an error like this: Traceback (most recent call last): File "/home/frank/ss_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 295, in <module> main(sys.argv) File "/home/frank/ss_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 288, in main seg_cnn = SemanticCloud(gen_pcl = True) File "/home/frank/ss_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'

jolags313 commented 3 months ago

I'm trying to use my own model too and I have trained a PSPnet model with ADE20K dataset. But the console give me an error like this: Traceback (most recent call last): File "/home/frank/ss_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 295, in <module> main(sys.argv) File "/home/frank/ss_ws/src/semantic_slam/semantic_cloud/src/semantic_cloud.py", line 288, in main seg_cnn = SemanticCloud(gen_pcl = True) File "/home/frank/ss_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'

Were you able to solve this issue? I'm seeing the same thing