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

SSFTTnet.py下SSFTTnet类下的forward #5

Open
renxiaosa00 opened this issue Oct 26, 2022 · 11 comments
Open

SSFTTnet.py下SSFTTnet类下的forward #5

renxiaosa00 opened this issue Oct 26, 2022 · 11 comments

Comments

@renxiaosa00
Copy link

SSFTTnet.py下SSFTTnet类下的forward:
“wa = rearrange(self.token_wA, 'b h w -> b w h') # Transpose
A = torch.einsum('bij,bjk->bik', x, wa)”
wa是torch.Size([1, 64, 4])
x是torch.Size([64, 81, 64])
这块bij bjk里面的b不一样

@renxiaosa00
Copy link
Author

针对上面的矩阵相乘问题,把batchsize改为1 就能正常运行了。但是我的测试结果看起来很差,以下是我运行IP_train.py的测试结果(cls_result文件夹下的classification_report.txt):
948.4029698 Training_Time (s)
27.093542400000047 Test_time (s)
41.496466971499125 Kappa accuracy (%)
47.447154471544714 Overall accuracy (%)
38.5506819506469 Average accuracy (%)
[ 0. 46.30350195 75.90361446 88.2629108 30.8045977 2.58751903
0. 36.51162791 0. 65.82857143 30.54298643 65.73033708
0. 78.48990342 54.17867435 41.66666667] Each accuracy (%)
precision recall f1-score support

                 Alfalfa     0.0000    0.0000    0.0000        41
             Corn-notill     0.3866    0.4630    0.4214      1285
            Corn-mintill     0.3375    0.7590    0.4672       747
                    Corn     0.2503    0.8826    0.3900       213
           Grass-pasture     0.9437    0.3080    0.4645       435
             Grass-trees     0.1083    0.0259    0.0418       657
     Grass-pasture-mowed     0.0000    0.0000    0.0000        25
           Hay-windrowed     0.5970    0.3651    0.4531       430
                    Oats     0.0000    0.0000    0.0000        18
          Soybean-notill     0.4028    0.6583    0.4998       875
         Soybean-mintill     0.7450    0.3054    0.4332      2210
           Soybean-clean     0.5000    0.6573    0.5680       534
                   Wheat     0.0000    0.0000    0.0000       185
                   Woods     0.8434    0.7849    0.8131      1139

Buildings-Grass-Trees-Drives 0.4845 0.5418 0.5116 347
Stone-Steel-Towers 0.2991 0.4167 0.3483 84

                accuracy                         0.4745      9225
               macro avg     0.3686    0.3855    0.3382      9225
            weighted avg     0.5377    0.4745    0.4584      9225

[[ 0 0 0 5 0 5 0 0 0 12 1 0 0 18 0 0]
[ 4 595 263 60 0 14 0 13 20 220 19 41 15 8 12 1]
[ 0 21 567 42 0 0 0 11 0 43 0 15 0 0 48 0]
[ 0 0 14 188 0 1 0 0 1 0 0 0 0 9 0 0]
[ 0 41 42 25 134 0 0 0 0 136 30 2 2 1 19 3]
[ 0 60 129 135 8 17 0 23 1 128 24 102 1 23 3 3]
[ 0 0 0 0 0 0 0 0 0 0 25 0 0 0 0 0]
[ 0 49 56 42 0 1 0 157 0 1 69 23 0 32 0 0]
[ 0 0 8 10 0 0 0 0 0 0 0 0 0 0 0 0]
[ 7 56 12 37 0 67 0 13 1 576 0 13 0 26 62 5]
[ 3 641 366 74 0 14 0 12 27 304 675 42 0 39 8 5]
[ 0 13 37 20 0 23 0 17 6 8 0 351 0 10 36 13]
[ 0 0 151 34 0 0 0 0 0 0 0 0 0 0 0 0]
[ 0 46 0 24 0 15 0 0 0 0 63 31 2 894 12 52]
[ 0 17 35 55 0 0 0 17 0 2 0 33 0 0 188 0]
[ 0 0 0 0 0 0 0 0 0 0 0 49 0 0 0 35]]

@chanrunz
Copy link

你好,您说的那个“把batchsize改为1 就能正常运行了”这个在哪里改,在那个地方呀

@renxiaosa00
Copy link
Author

你好,您说的那个“把batchsize改为1 就能正常运行了”这个在哪里改,在那个地方呀

IP_train.py
BATCH_SIZE_TRAIN = 1
def create_data_loader():的上面一行

@renqi1998
Copy link

你这么改肯定低,我跑出来比作者论文中给的还高

@chanrunz
Copy link

你这么改肯定低,我跑出来比作者论文中给的还高

您好,请问,您是怎么正常跑通的呢,为什么我的一直报那个维度错误,然后我尝试把batch_size也改成64,可以运行了,然后后面还是报那个错误,可以加您个联系方式嘛,或者麻烦您加一下我qq1342720383。谢谢啦

@chanrunz
Copy link

你这么改肯定低,我跑出来比作者论文中给的还高

希望可以得到您的回复,这个问题困扰我很久啦,谢谢

@gqy122
Copy link

gqy122 commented Mar 7, 2023

作者您好,我在运行您的代码时一直报这个错误:Exception: test() missing 3 required positional arguments: 'device', 'net', and 'test_loader'。您看是我哪个地方没有调试好吗,希望得到您得指点

@oneac
Copy link

oneac commented Mar 13, 2023

您好,关于那个维度错误的问题,请问您知道怎么正常跑通的了吗?谢谢啦

@renqi1998
Copy link

你环境没配好,重新配一遍就行

@commander123kekou
Copy link

你这么改肯定低,我跑出来比作者论文中给的还高

您好,请问,您是怎么正常跑通的呢,为什么我的一直报那个维度错误,然后我尝试把batch_size也改成64,可以运行了,然后后面还是报那个错误,可以加您个联系方式嘛,或者麻烦您加一下我qq1342720383。谢谢啦

请问你的问题解决了吗?

@renxiaosa00
Copy link
Author

renxiaosa00 commented Jun 12, 2023 via email

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

6 participants