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

When I use RGB_ ResNet50_ SUN model, select ONLY_ RGB: TRUE, the evaluation.py report an error #30

Open
sayakawaiiyo opened this issue Oct 17, 2023 · 3 comments

Comments

@sayakawaiiyo
Copy link

in config_SUN397.yaml:
MODEL:
ARCH: ResNet-50
PATH: ./Data/Model Zoo/SUN397/
NAME: RGB_ResNet50_SUN
ONLY_RGB: TRUE
ONLY_SEM: FALSE

TRAINING:
PRINT_FREQ: 10
PRECOMPUTED_SEM: FALSE
BATCH_SIZE:
TRAIN: 100
TEST: 1
LR: 2.5e-4
LR_DECAY: 10
MOMENTUM: 0.9
OPTIMIZER: DFW
POLY_POWER: 0.9
WEIGHT_DECAY: 5.0e-4
AVERAGE_LOSS: 20

VALIDATION:
PRINT_FREQ: 10
BATCH_SIZE:
TRAIN: 100
TEST: 1
TEN_CROPS: TRUE

error:
FileNotFoundError: [Errno 2] No such file or directory: './Data/Datasets/SUN397/noisy_annotations_RGB/val/conference_room/sun_aatxlublfjchvvzu.png'

the model is selecting PRECOMPUTED_ SEM: FALSE , still required noise_ Annotations_ RGB and noise_ Annotations_Scores ?

Thank you very much for answering my question!

@alexlopezcifuentes
Copy link
Member

Hi! Thanks for your question!

It's been some time since the creation of this code so I will try to do my best to recall. I have been checking the code and it might be true that even though you are just using the RGB network the code still needs the precomputed semantic segmentations.

Actually, if you take a look at the forward method of the RGBBranch:

    def forward(self, x, sem):
        """
        Netowrk forward
        :param x: RGB Image
        :return: Scene recognition predictions
        """
        # --------------------------------#
        #           RGB Branch            #
        # ------------------------------- #
        x, pool_indices = self.in_block(x)
        e1 = self.encoder1(x)
        e2 = self.encoder2(e1)
        e3 = self.encoder3(e2)
        e4 = self.encoder4(e3)


        # -------------------------------------#
        #            RGB Classifier            #
        # ------------------------------------ #
        act = self.avgpool(e4)
        act = act.view(act.size(0), -1)
        act = self.dropout(act)
        act = self.fc(act)


        act_rgb = act
        act_sem = act


        return act, e4, act_rgb, act_sem

It still needs semantic segmentation as an argument although it is not used.

Sorry for that inconvenience, unfortunately, I am currently unable to make code changes so you will need to download the data or change the code yourself.

@sayakawaiiyo
Copy link
Author

你好!谢谢你的提问!

这段代码创建已经有一段时间了,所以我会尽力回忆一下。我一直在检查代码,即使您只是使用 RGB 网络,代码仍然需要预先计算的语义分割,这可能是正确的。

实际上,如果你看一下RGBBranch 的forward方法

    def forward(self, x, sem):
        """
        Netowrk forward
        :param x: RGB Image
        :return: Scene recognition predictions
        """
        # --------------------------------#
        #           RGB Branch            #
        # ------------------------------- #
        x, pool_indices = self.in_block(x)
        e1 = self.encoder1(x)
        e2 = self.encoder2(e1)
        e3 = self.encoder3(e2)
        e4 = self.encoder4(e3)


        # -------------------------------------#
        #            RGB Classifier            #
        # ------------------------------------ #
        act = self.avgpool(e4)
        act = act.view(act.size(0), -1)
        act = self.dropout(act)
        act = self.fc(act)


        act_rgb = act
        act_sem = act


        return act, e4, act_rgb, act_sem

尽管没有使用,但它仍然需要语义分割作为参数。

对于给您带来的不便,我们深表歉意,不幸的是,我目前无法更改代码,因此您需要下载数据或自行更改代码。

Thank you for your answer. I will use semantic-segmentation-pytorch to complete a scene recognition for any individual image

@sayakawaiiyo
Copy link
Author

    act = self.avgpool(e4)
    act = act.view(act.size(0), -1)
    act = self.dropout(act)
    act = self.fc(act)


    act_rgb = act
    act_sem = act


    return act, e4, act_rgb, act_sem

尽管没有使用,但它仍然需要语义分割作为参数。

对于给您带来的不便,我们深表歉意,不幸的是,我目前无法更改代码,因此您需要下载数据或自行更改代码。

Hi! Thanks for your question!

It's been some time since the creation of this code so I will try to do my best to recall. I have been checking the code and it might be true that even though you are just using the RGB network the code still needs the precomputed semantic segmentations.

Actually, if you take a look at the forward method of the RGBBranch:

    def forward(self, x, sem):
        """
        Netowrk forward
        :param x: RGB Image
        :return: Scene recognition predictions
        """
        # --------------------------------#
        #           RGB Branch            #
        # ------------------------------- #
        x, pool_indices = self.in_block(x)
        e1 = self.encoder1(x)
        e2 = self.encoder2(e1)
        e3 = self.encoder3(e2)
        e4 = self.encoder4(e3)


        # -------------------------------------#
        #            RGB Classifier            #
        # ------------------------------------ #
        act = self.avgpool(e4)
        act = act.view(act.size(0), -1)
        act = self.dropout(act)
        act = self.fc(act)


        act_rgb = act
        act_sem = act


        return act, e4, act_rgb, act_sem

It still needs semantic segmentation as an argument although it is not used.

Sorry for that inconvenience, unfortunately, I am currently unable to make code changes so you will need to download the data or change the code yourself.

Hello, I'm sorry to bother you again! What I want to inquire about is how to obtain the images in folders noisy_annotations and noisy_scores, and how do you convert the output results of semantic segmentation into this?

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

2 participants