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

您好,怎么训练两个呀?s1和s2 #5

Open
201811510210hjx opened this issue Mar 7, 2023 · 13 comments
Open

您好,怎么训练两个呀?s1和s2 #5

201811510210hjx opened this issue Mar 7, 2023 · 13 comments

Comments

@201811510210hjx
Copy link

您好,怎么训练两个呀?s1和s2

@hw2hwei
Copy link
Owner

hw2hwei commented Mar 7, 2023

您好,怎么训练两个呀?s1和s2

Usage里面有介绍怎么训练。
以AID,resnet18为例,先运行python main.py --dataset AID --arch resnet18 --mode s1,再运行python main.py --dataset AID --arch resnet18 --mode s2

@201811510210hjx
Copy link
Author

连续执行两次main文件吗?

@hw2hwei
Copy link
Owner

hw2hwei commented Mar 7, 2023

连续执行两次main文件吗?

是的,等s1训练完后再运行s2

@201811510210hjx
Copy link
Author

您好,我执行了s1之后,为什么s1的train准确率达到了100%呀?

@201811510210hjx
Copy link
Author

您好,为什么test文件当执行s1时就会报错呀?
显示:
heat_map = heat_map[0].cpu().detach().numpy()
TypeError: 'NoneType' object is not subscriptable

@hw2hwei
Copy link
Owner

hw2hwei commented Mar 14, 2023

您好,为什么test文件当执行s1时就会报错呀? 显示: heat_map = heat_map[0].cpu().detach().numpy() TypeError: 'NoneType' object is not subscriptable

你需要一步步地debug一下,看看是哪一步的数据生成错了、或者没有生成/读取到

@201811510210hjx
Copy link
Author

它生成完第一个之后就显示为空了。
1 : ./datasets/UCM/images/agricultural/agricultural48.tif
下一个就为空报错了

@201811510210hjx
Copy link
Author

设置为s2时正常运行,设置s1时就报错了

@201811510210hjx
Copy link
Author

打扰您了,我还有一个疑问。训练完s1和s2后分别得到了s1和s2的准确度,要自己手动计算两个准确度的平均值么?要怎么发现最终的准确度呢?

@hw2hwei
Copy link
Owner

hw2hwei commented Mar 14, 2023

设置为s2时正常运行,设置s1时就报错了

当前代码在设置s2训练时,会把s1的参数覆盖掉,如果你想保留s1的参数并进行测试的话需要修改一下代码

@201811510210hjx
Copy link
Author

打扰您了,我还有一个疑问。训练完s1和s2后分别得到了s1和s2的准确度,要自己手动计算两个准确度的平均值么?要怎么发现最终的准确度呢?

@hw2hwei
Copy link
Owner

hw2hwei commented Mar 17, 2023

打扰您了,我还有一个疑问。训练完s1和s2后分别得到了s1和s2的准确度,要自己手动计算两个准确度的平均值么?要怎么发现最终的准确度呢?

源代码里面有,当mode==s2的时候进行求s1、s2的平均值。

@Hpu-wcx
Copy link

Hpu-wcx commented Jul 1, 2023

你好,请教一下,为什么先训练模型S1,在训练模型S2,模型S1对S2有什么影响吗?代码里看不出有S1对S2有什么影响,但是实际运行效果却是很好

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

3 participants