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

试运行detect.py上遇到的问题 #6

Open
hotea1 opened this issue Nov 18, 2022 · 3 comments
Open

试运行detect.py上遇到的问题 #6

hotea1 opened this issue Nov 18, 2022 · 3 comments

Comments

@hotea1
Copy link

hotea1 commented Nov 18, 2022

老师,学长们好,我是一名研一学生,由于代码能力不足没能成功进行利用您的代码对LEVIR_SHIP进行预测,想向您提一点问题:
image
如图在detect.py中存在引用了未定义函数的情况,删去未定义的stride后,会出现似乎是尺寸不对应的问题,“RuntimeError: The size of tensor a (400) must match the size of tensor b (256) at non-singleton dimension 1”,请问该如何解决呢。

@hotea1
Copy link
Author

hotea1 commented Nov 18, 2022

image

@WindVChen
Copy link
Owner

你好呀@hotea1

这个问题是因为400不是32的整数倍引起的。在DRENet网络中,feature map的长宽至多会缩小到原图的1/32(见Readme中的DRENet网络结构图),因此需要保证输入图像是32的整数倍。

你可以直接通过设置detect.py中的参数“--img-size”为32的整数倍来避免上述错误(例如设置为512),该设置会在你图像的边缘加入padding,因此不会改动你图像的空间分辨率(当然你也可以自行放缩图像到32的整数倍)。

此外,之前的detect.py需要做些许改动才能运行,我们更新了新的版本,请使用最新的detect.py文件。

如果觉得该方法有帮助的话,也可以给我们加:star:呀~

@hotea1
Copy link
Author

hotea1 commented Nov 20, 2022

谢谢!已经能够运行了!

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