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

求教怎么改能降低显存占用 #41

Open
nistarlwc opened this issue Jan 20, 2025 · 4 comments
Open

求教怎么改能降低显存占用 #41

nistarlwc opened this issue Jan 20, 2025 · 4 comments

Comments

@nistarlwc
Copy link

nistarlwc commented Jan 20, 2025

我已经修改成了用sam2_hiera_small结构来训练。
但是我现在想跑1024尺寸的图像,12GB的显卡只能跑2个batch size。
还能怎么修改能降低些显存占用呢?

@xiongxyowo
Copy link
Collaborator

Hi, the following strategies can be adopted:

  • Adopt a stronger encoder channel compression strategy. The current RFB compresses the channel to 64, you can try lower values.
  • Replace RFB with a simple 1×1 convolution.
  • Remove the last decoder block (Up3). In other words, the final result is obtained by 8 times upsampling instead of 4 times.

Note that these strategies may lead to a decrease in segmentation accuracy.


同学你好,一般可以采用如下几个策略:

  • 采用更激进的编码器通道压缩策略。目前的RFB将通道压缩至了64,你可以尝试更低的值。
  • 将RFB替换为简单的1×1卷积。
  • 移除最后一个解码器块(Up3)。即,最终结果通过8倍上采样得到而非4倍。

注意这些策略可能导致分割精度的下降。

@Lei0829
Copy link

Lei0829 commented Feb 2, 2025

Hi, the following strategies can be adopted:

  • Adopt a stronger encoder channel compression strategy. The current RFB compresses the channel to 64, you can try lower values.
  • Replace RFB with a simple 1×1 convolution.
  • Remove the last decoder block (Up3). In other words, the final result is obtained by 8 times upsampling instead of 4 times.

Note that these strategies may lead to a decrease in segmentation accuracy.

同学你好,一般可以采用如下几个策略:

  • 采用更激进的编码器通道压缩策略。目前的RFB将通道压缩至了64,你可以尝试更低的值。
  • 将RFB替换为简单的1×1卷积。
  • 移除最后一个解码器块(Up3)。即,最终结果通过8倍上采样得到而非4倍。

注意这些策略可能导致分割精度的下降。

如果我想要效果对比图,可是训练出来的像素很低,也是采用上述方法么

@Lei0829
Copy link

Lei0829 commented Feb 2, 2025

Hi, the following strategies can be adopted:

  • Adopt a stronger encoder channel compression strategy. The current RFB compresses the channel to 64, you can try lower values.
  • Replace RFB with a simple 1×1 convolution.
  • Remove the last decoder block (Up3). In other words, the final result is obtained by 8 times upsampling instead of 4 times.

Note that these strategies may lead to a decrease in segmentation accuracy.

同学你好,一般可以采用如下几个策略:

  • 采用更激进的编码器通道压缩策略。目前的RFB将通道压缩至了64,你可以尝试更低的值。
  • 将RFB替换为简单的1×1卷积。
  • 移除最后一个解码器块(Up3)。即,最终结果通过8倍上采样得到而非4倍。

注意这些策略可能导致分割精度的下降。

Image

Image而且我发现训练输出的结果图并不是352352而是45712867

@xiongxyowo
Copy link
Collaborator

Hi, we created a wechat discussion group, please refer to wechat.jpg for more details.

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