kaiwang960112 / Self-Cure-Network

This is a novel and easy method for annotation uncertainties.
409 stars 96 forks source link

test.py模型加载不正确 #50

Closed zzx820302704 closed 9 months ago

zzx820302704 commented 3 years ago

image 这个模型读进去没有权限D:/chengxu/Self-Cure-Network-master/models/epoch47_acc0.8683.pth/ image 而加入D:/chengxu/Self-Cure-Network-master/models/epoch47_acc0.8683.pth/ijba_res18_naive.pth.tar之后模型加载出现错误 我对于您发布的SCN很感兴趣,想要复现您的代码,但是遇到了一些问题,感谢您的解答。

1617226214 commented 3 years ago

我也遇到了这个问题,请问你解决了么

kaiwang960112 commented 3 years ago

这就是那个keys的名字多一个module.和少一个module.的问题,你在keys导入模型那里设置一下就好了

1617226214 @.***> 於 2021年7月2日週五 下午7:59寫道:

我也遇到了这个问题,请问你解决了么

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kaiwang960112/Self-Cure-Network/issues/50#issuecomment-872943727, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6LK4DO62NTXGZLWLD3MXLTVWS2HANCNFSM45IZ3PMA .

1617226214 commented 3 years ago

@kaiwang960112 你好,去掉Module之后出现了最后的FC维度不匹配的问题。 image

1617226214 commented 3 years ago

最后两层FC的维度跟代码上对不上 image

kaiwang960112 commented 3 years ago

load那里有个strict设置成false看看

1617226214 @.***> 於 2021年7月3日週六 下午1:57寫道:

最后两层FC的维度跟代码上对不上 [image: image] https://user-images.githubusercontent.com/79970592/124344711-7bced880-dc06-11eb-91b6-d7a11dc32445.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kaiwang960112/Self-Cure-Network/issues/50#issuecomment-873352279, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6LK4HYK4X2D7LDXA24UPLTV2RD5ANCNFSM45IZ3PMA .

1617226214 commented 3 years ago

@kaiwang960112 设置过了,设置后,同样的图片每次验证结果都会变掉。

kaiwang960112 commented 3 years ago

这有点奇怪哈

1617226214 @.***> 於 2021年7月4日週日 上午9:49寫道:

@kaiwang960112 https://github.com/kaiwang960112 设置过了,设置后,同样的图片每次验证结果都会变掉。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kaiwang960112/Self-Cure-Network/issues/50#issuecomment-873498835, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6LK4HCRPA56GQXHOUUBKTTV644JANCNFSM45IZ3PMA .

1617226214 commented 3 years ago

这有点奇怪哈 1617226214 @.***> 於 2021年7月4日週日 上午9:49寫道: @kaiwang960112 https://github.com/kaiwang960112 设置过了,设置后,同样的图片每次验证结果都会变掉。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#50 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6LK4HCRPA56GQXHOUUBKTTV644JANCNFSM45IZ3PMA .

是的,没准是预训练参数里面没有最后两层的分类FC,所以FC每次都是初始化造成每次分类都不一样。

xiongzhu666 commented 3 years ago

是的,没准是预训练参数里面没有最后两层的分类FC,所以FC每次都是初始化造成每次分类都不一样。

您好,我也遇到这个每次推理结果不一致的问题,请问这个问题最后是如何解决的???

yangjian1218 commented 2 years ago

load那里有个strict设置成false看看 1617226214 @.***> 於 2021年7月3日週六 下午1:57寫道: 最后两层FC的维度跟代码上对不上 [image: image] https://user-images.githubusercontent.com/79970592/124344711-7bced880-dc06-11eb-91b6-d7a11dc32445.png — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#50 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6LK4HYK4X2D7LDXA24UPLTV2RD5ANCNFSM45IZ3PMA .

@kaiwang960112 请问在哪里设置?