Closed yashmewada9618 closed 1 year ago
π Hello @yashmewada9618, thank you for leaving an issue on Roboflow Notebooks.
If you are filing a bug report, please be as detailed as possible. This will help us more easily diagnose and resolve the problem you are facing. To learn more about contributing, check out our Contributing Guidelines.
If you require support with custom code that is not part of Roboflow Notebooks, please reach out on the Roboflow Forum or on the GitHub Discussions page associated with this repository.
Do you have more questions about Roboflow that we haven't responded to yet? Feel free to ask them on the Roboflow Discuss forum. Our developer advocates and community team actively respond to questions there.
To ask questions about Notebooks, head over to the GitHub Discussions section of this repository.
So, it turns out I was incorrectly implementing the loaf_from_checkpoint()
. The correct way to do that is
segformer_finetuner = SegformerFinetuner(id2label=id2label,lable2id=label2id,color_map=color_map).load_from_checkpoint(path,id2label=id2label,lable2id=label2id)
.
And I was able to successfully load and predict from the saved checkpoint.
Hi @yashmewada9618 ππ»! It is awesome to hear that you were able to solve your issue. π
Search before asking
Notebook name
train-segformer-segmentation-on-custom-data.ipynb
Bug
Hii, I am trying to replicate the output of the segformer on my machine and I rearranged the code for my dataset. I input this code using the RUGD dataset. The training was done without errors, and the ckpt file was also saved.
I am trying to load the checkpoint file and I am unsuccessful in that.
Also below is my edited
__init__()
function of the SegformerFinetuner class. To the best knowledge, the error seems to be in the inheritance implementation (correct me if I am wrong).After these alterations in the code, I got the below error.
Also, the implementation of the below method doesn't work as it looks for the
model_state_dict
key in the ckpt file and PL saves it asstate_dict
and changing the key name doesn't seem to help.Environment
Minimal Reproducible Example
SegformerFunetuner class init function.
Main loop
if name == "main": color_map = pd.read_csv('/media/yash/T7/Fine_Tune_Segformer/RUGD_sample-data/RUGD_annotation-colormap.txt', sep=" ", header=None) color_map.columns = ["label_idx", "label", "R", "G", "B"] color_map.head()
Additional
No response
Are you willing to submit a PR?