💡 [REQUEST] - Neural Style Transfer: use AvgPool2d
维护者通常 2 天内回复
@sekyondaMeta 已经在做这个了。
开始于 2026年4月27日。
评估
这个 Issue 还没有评估数据。
描述
🚀 Describe the improvement or the new tutorial
Neural Style Transfer utilizes VGG network, which uses maximum pooling.
Although Original article suggests using average pooling instead for better results:
For image synthesis we found that replacing the maximum
pooling operation by average pooling yields slightly more
appealing results, which is why the images shown were generated with average pooling.
This is unsurprising, considering that max pooling may hide gradients of lower layers, while average pooling preserves them, so gradient descent for reconstructing image works better.
I confirm that it actually improves results.
Suggested changes
Replace that:
elif isinstance(layer, nn.MaxPool2d):
name = 'pool_{}'.format(i)
with that:
elif isinstance(layer, nn.MaxPool2d):
name = 'pool_{}'.format(i)
layer = nn.AvgPool2d(
kernel_size=layer.kernel_size,
stride=layer.stride,
padding=layer.padding,
ceil_mode=layer.ceil_mode)
Existing tutorials on this topic
https://docs.pytorch.org/tutorials/advanced/neural_style_tutorial.html
Additional context
No response
cc @albanD @jbschlosser
- 主要语言
- Python
- 星标
- 9.4k
- 派生
- 4.4k
- 平均合并
- 3 天 5 小时
- 30 天内合并 PR
- 4
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pytorch/tutorials 的其他 Issue
-
Feedback about Datasets & DataLoaders可能已有人在做 @hippi345 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复
-
💡 [REQUEST] - Add model.eval() after loading the mdoel可能已有人在做 @Justee21 于 26 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 78/100
维护者通常 2 天内回复
-
[BUG] Captum tutorial fails when visualize_image_attr() receives None for original_image可能重新可做 @shubhambhar007 于 32 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
pytorch/tutorials#3963 · 1 条评论 ·
维护者通常 2 天内回复
-
[BUG] - Incorrect ResNet18 preprocessing in Captum tutorial可能已有人在做 @austxu 于 85 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 2 天内回复
-
Feedback about What is torch.nn really?可能已有人在做 @MichelleHan7 于 22 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 78/100
维护者通常 2 天内回复
查看 pytorch/tutorials 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
cellrishi-code/claude-skills-atlas#165 ·
维护者通常 1 天内回复
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 72/100
open-webui/open-webui#32635 · 1 条评论 ·
维护者通常 1 天内回复
-
Filters: ?field:ne=null matches NULL rows instead of non-NULL ones可能已有人在做 @rshdhere 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
Netflix/metaflow-service#504 ·
-
needs-triage
难度 2/5 1-3 小时 新手友好度 84/100
gke-labs/kube-agents#3394 ·
维护者通常 1 天内回复
-
A2A audit timestamps end in +00:00Z (invalid ISO 8601)可能已有人在做 @O1sumitkumar 今天认领。 未关闭bug good first issue help wanted python
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复