# vision

**URL:** https://discuss.pytorch.org/c/vision/5.md

[Latest](https://discuss.pytorch.org/latest.md) · [Categories](https://discuss.pytorch.org/categories.md)

---

## [About the vision category](https://discuss.pytorch.org/t/about-the-vision-category/22)

<div class="topic-metadata">

**Author:** [@smth](https://discuss.pytorch.org/u/smth)\
**Replies:** 4\
**Last updated:** [November 28, 2023, 7:11am UTC](https://discuss.pytorch.org/t/about-the-vision-category/22 "2023-11-28T07:11:20Z")

</div>

Topics related to either pytorch/vision or vision research related topics

---

## [License clarification for Torchvision ResNet50 weights and fine-tuned checkpoints](https://discuss.pytorch.org/t/license-clarification-for-torchvision-resnet50-weights-and-fine-tuned-checkpoints/225542)

<div class="topic-metadata">

**Author:** [@L1239301](https://discuss.pytorch.org/u/L1239301)\
**Replies:** 0\
**Last updated:** [October 14, 2026, 1:31pm UTC](https://discuss.pytorch.org/t/license-clarification-for-torchvision-resnet50-weights-and-fine-tuned-checkpoints/225542 "2026-10-14T13:31:17Z")

</div>

Hello, Could a Torchvision maintainer help clarify the license applicable to this pretrained ResNet50 checkpoint? File: resnet50-0676ba61.pth Source: https://download.pytorch.org/models/resnet50-0676ba61.pth We use t…

---

## [Multi label classification accuracy calculation](https://discuss.pytorch.org/t/multi-label-classification-accuracy-calculation/225513)

<div class="topic-metadata">

**Author:** [@Darhen](https://discuss.pytorch.org/u/Darhen)\
**Replies:** 2\
**Last updated:** [October 10, 2026, 10:10am UTC](https://discuss.pytorch.org/t/multi-label-classification-accuracy-calculation/225513 "2026-10-10T10:10:03Z")

</div>

Hello, I have a dataset with images and a tensor of multi labels in one hot encoding. During the training I am not able to calculate the accuracy, when I print the predictions for the batch what I am getting is a single …

---

## [Active-speaker-driven video cropping: what the inference actually cost](https://discuss.pytorch.org/t/active-speaker-driven-video-cropping-what-the-inference-actually-cost/225447)

<div class="topic-metadata">

**Author:** [@ColinGPT9](https://discuss.pytorch.org/u/ColinGPT9)\
**Replies:** 0\
**Last updated:** [September 23, 2026, 12:29am UTC](https://discuss.pytorch.org/t/active-speaker-driven-video-cropping-what-the-inference-actually-cost/225447 "2026-09-23T00:29:51Z")

</div>

Sharing a local video pipeline and, more usefully, the two inference lessons that cost me the most time. The task: crop a 16:9 stream to 9:16 following whoever is speaking. YOLOv8 for people, OpenCV for the crop path,…

---

## [Loading old FastAI XResNet50 pretrained weights into newer XResNet implementation](https://discuss.pytorch.org/t/loading-old-fastai-xresnet50-pretrained-weights-into-newer-xresnet-implementation/225345)

<div class="topic-metadata">

**Author:** [@shadious](https://discuss.pytorch.org/u/shadious)\
**Replies:** 0\
**Last updated:** [August 30, 2026, 2:42pm UTC](https://discuss.pytorch.org/t/loading-old-fastai-xresnet50-pretrained-weights-into-newer-xresnet-implementation/225345 "2026-08-30T14:42:07Z")

</div>

Loading old FastAI XResNet50 pretrained weights into newer XResNet implementation Hi, I am using FastAI with xresnet50 as the encoder of a DynamicUnet, and I am having trouble correctly loading the FastAI pretrained XRe…

---

## [Near-duplicate detection for image drafts with torchvision embeddings](https://discuss.pytorch.org/t/near-duplicate-detection-for-image-drafts-with-torchvision-embeddings/225206)

<div class="topic-metadata">

**Author:** [@Martyn\_Foster](https://discuss.pytorch.org/u/Martyn_Foster)\
**Replies:** 0\
**Last updated:** [July 21, 2026, 1:03pm UTC](https://discuss.pytorch.org/t/near-duplicate-detection-for-image-drafts-with-torchvision-embeddings/225206 "2026-07-21T13:03:00Z")

</div>

I’m sketching out a pipeline to flag near-duplicate drafts pulled from an external browser-based image generation source (in my case, Nano Banana 2 Lite, a third-party independent tool site unrelated to Google or DeepMin…

---

## [How does grid\_sample(x, grid) work?](https://discuss.pytorch.org/t/how-does-grid-sample-x-grid-work/15401)

<div class="topic-metadata">

**Author:** [@dingwang](https://discuss.pytorch.org/u/dingwang)\
**Replies:** 23\
**Last updated:** [July 7, 2026, 7:11am UTC](https://discuss.pytorch.org/t/how-does-grid-sample-x-grid-work/15401 "2026-07-07T07:11:02Z")

</div>

I don’t know how grid\_sample() compute the output base on the grid and input?Does any one give me an example？Thank you.

---

## [Megabots2026: Leveraging torch.compile for High-Performance Dual-Agent Architecture](https://discuss.pytorch.org/t/megabots2026-leveraging-torch-compile-for-high-performance-dual-agent-architecture/225146)

<div class="topic-metadata">

**Author:** [@sundaram](https://discuss.pytorch.org/u/sundaram)\
**Replies:** 0\
**Last updated:** [July 4, 2026, 4:11pm UTC](https://discuss.pytorch.org/t/megabots2026-leveraging-torch-compile-for-high-performance-dual-agent-architecture/225146 "2026-07-04T16:11:30Z")

</div>

Hi everyone, As I lay down the foundation for Megabots2026, it has become incredibly clear that PyTorch is the best possible ecosystem to start this project. The architecture relies on a specialized, high-speed dual-ag…

---

## [Megabots2026: Proposing a Dual-Agent (Generator/Verifier) Training Pattern for High-Accuracy Systems](https://discuss.pytorch.org/t/megabots2026-proposing-a-dual-agent-generator-verifier-training-pattern-for-high-accuracy-systems/225145)

<div class="topic-metadata">

**Author:** [@sundaram](https://discuss.pytorch.org/u/sundaram)\
**Replies:** 0\
**Last updated:** [July 4, 2026, 4:00pm UTC](https://discuss.pytorch.org/t/megabots2026-proposing-a-dual-agent-generator-verifier-training-pattern-for-high-accuracy-systems/225145 "2026-07-04T16:00:39Z")

</div>

Github Repo : GitHub - powerofaisinstudy-debug/Megabots2026- · GitHub Hi everyone, I wanted to share an architectural design concept I am exploring for a project called Megabots2026. The goal is to scale deep learning …

---

## [\[learn-the-basics/quickstart#4\] Datasets & DataLoaders: Iterating and Visualizing the Dataset: newbie's question about labels\_map](https://discuss.pytorch.org/t/learn-the-basics-quickstart-4-datasets-dataloaders-iterating-and-visualizing-the-dataset-newbies-question-about-labels-map/225063)

<div class="topic-metadata">

**Author:** [@SalomonCHUNG](https://discuss.pytorch.org/u/SalomonCHUNG)\
**Replies:** 0\
**Last updated:** [June 8, 2026, 1:42pm UTC](https://discuss.pytorch.org/t/learn-the-basics-quickstart-4-datasets-dataloaders-iterating-and-visualizing-the-dataset-newbies-question-about-labels-map/225063 "2026-06-08T13:42:51Z")

</div>

Hello, TL;DR Instead of tutorials/beginner\_source/basics /data\_tutorial.py#L77 labels\_map = { 0: "T-Shirt", 1: "Trouser", \[...\] 9: "Ankle Boot", } can I use vision/torchvision/datasets /mnist.py#L229 …

---

## [ICD & AICD: saliency-guided masking augmentation for vision models (method preprint + PyTorch impl)](https://discuss.pytorch.org/t/icd-aicd-saliency-guided-masking-augmentation-for-vision-models-method-preprint-pytorch-impl/225058)

<div class="topic-metadata">

**Author:** [@Mateusz\_Walo](https://discuss.pytorch.org/u/Mateusz_Walo)\
**Replies:** 0\
**Last updated:** [June 8, 2026, 11:46am UTC](https://discuss.pytorch.org/t/icd-aicd-saliency-guided-masking-augmentation-for-vision-models-method-preprint-pytorch-impl/225058 "2026-06-08T11:46:43Z")

</div>

Hi all, I wanted to share two data augmentation methods we’ve been working on, ICD (Intelligent Coarse Dropout) and AICD (Anti-ICD), together with a reference PyTorch implementation. The idea. Standard masking augmenta…

---

## [PyTorch training issue with EfficientNetB3 | Validation Accuracy plateu](https://discuss.pytorch.org/t/pytorch-training-issue-with-efficientnetb3-validation-accuracy-plateu/224816)

<div class="topic-metadata">

**Author:** [@Marco](https://discuss.pytorch.org/u/Marco)\
**Replies:** 4\
**Last updated:** [May 22, 2026, 5:09pm UTC](https://discuss.pytorch.org/t/pytorch-training-issue-with-efficientnetb3-validation-accuracy-plateu/224816 "2026-05-22T17:09:59Z")

</div>

Before I start, I wanted to add that I’m relatively new to deep learning, so my setup may be overly complex or suboptimal. I’m training an image classification model (EfficientNet-B3 on grayscale Kanji images) using …

---

## [C++ MNIST example code failed to compile on Linux WSL2](https://discuss.pytorch.org/t/c-mnist-example-code-failed-to-compile-on-linux-wsl2/224982)

<div class="topic-metadata">

**Author:** [@Matt](https://discuss.pytorch.org/u/Matt)\
**Replies:** 2\
**Last updated:** [May 21, 2026, 4:55am UTC](https://discuss.pytorch.org/t/c-mnist-example-code-failed-to-compile-on-linux-wsl2/224982 "2026-05-21T04:55:58Z")

</div>

Tried to compile and run the C++ MNIST training example on WSL2, but I ran into the following error at runtime, thought the compilation went very smooth. The system is Core Ultra 7 + RTX2000 Ada + Windows 11 + WSL2(Ubunt…

---

## [Pytorch v2 custom transforms](https://discuss.pytorch.org/t/pytorch-v2-custom-transforms/224935)

<div class="topic-metadata">

**Author:** [@pculverhouse](https://discuss.pytorch.org/u/pculverhouse)\
**Replies:** 1\
**Last updated:** [May 14, 2026, 4:57pm UTC](https://discuss.pytorch.org/t/pytorch-v2-custom-transforms/224935 "2026-05-14T16:57:49Z")

</div>

I am trying to get my own custom pad and resize operator for use inside a dataloader for a resnet50 classifier. The problem is that I cannot get this transform structure right, so that an image can be processed in a tra…

---

## [Fastai resnet50 dict keys are different from pytorch resnet50](https://discuss.pytorch.org/t/fastai-resnet50-dict-keys-are-different-from-pytorch-resnet50/224239)

<div class="topic-metadata">

**Author:** [@pculverhouse](https://discuss.pytorch.org/u/pculverhouse)\
**Replies:** 2\
**Last updated:** [May 13, 2026, 8:52pm UTC](https://discuss.pytorch.org/t/fastai-resnet50-dict-keys-are-different-from-pytorch-resnet50/224239 "2026-05-13T20:52:10Z")

</div>

I have a fastai resnet50 trained model saved as a PTH weights file. I try to open it in pytorch so I can convert it to ONNX format. I get a state\_dict load error telling me that a whole set of keys are missing and also…

---

## [How to approach an imbalanced image dataset for mobile image classification app?](https://discuss.pytorch.org/t/how-to-approach-an-imbalanced-image-dataset-for-mobile-image-classification-app/221208)

<div class="topic-metadata">

**Author:** [@myrmel4e83](https://discuss.pytorch.org/u/myrmel4e83)\
**Replies:** 9\
**Last updated:** [May 5, 2026, 7:50am UTC](https://discuss.pytorch.org/t/how-to-approach-an-imbalanced-image-dataset-for-mobile-image-classification-app/221208 "2026-05-05T07:50:30Z")

</div>

Hello, I’m a total newbie in image classification and I got really confused from all the available techniques for each step of the implementation of an image classification app - from the data preparation to model deploy…

---

## [Inference-time wrapper to improve SOTA torchvision classification accuracy on ImageNet-1K](https://discuss.pytorch.org/t/inference-time-wrapper-to-improve-sota-torchvision-classification-accuracy-on-imagenet-1k/224809)

<div class="topic-metadata">

**Author:** [@Zheng\_Li](https://discuss.pytorch.org/u/Zheng_Li)\
**Replies:** 1\
**Last updated:** [April 20, 2026, 9:21am UTC](https://discuss.pytorch.org/t/inference-time-wrapper-to-improve-sota-torchvision-classification-accuracy-on-imagenet-1k/224809 "2026-04-20T09:21:42Z")

</div>

Observation This proposal focuses on improving pretrained torchvision classification models through inference-time processing only. Model weights are unchanged No additional training is required Only image-level prepro…

---

## [How to skip a part of the model for back propagation?](https://discuss.pytorch.org/t/how-to-skip-a-part-of-the-model-for-back-propagation/164768)

<div class="topic-metadata">

**Author:** [@werthers](https://discuss.pytorch.org/u/werthers)\
**Replies:** 4\
**Last updated:** [April 20, 2026, 8:28am UTC](https://discuss.pytorch.org/t/how-to-skip-a-part-of-the-model-for-back-propagation/164768 "2026-04-20T08:28:01Z")

</div>

Hi there, I’m new to pytorch and I’d like to implement a GAN model, I see there’s a tutorial DCGAN Tutorial — PyTorch Tutorials 1.12.1+cu102 documentation, it uses two optimizer to backward the parameters of generator a…

---

## [How do I know the current version of pytorch?](https://discuss.pytorch.org/t/how-do-i-know-the-current-version-of-pytorch/6754)

<div class="topic-metadata">

**Author:** [@earnp](https://discuss.pytorch.org/u/earnp)\
**Replies:** 10\
**Last updated:** [April 16, 2026, 11:48am UTC](https://discuss.pytorch.org/t/how-do-i-know-the-current-version-of-pytorch/6754 "2026-04-16T11:48:42Z")

</div>

How do I know the current version of pytorch?

---

## [Soumitra Dutta Oxford-How do I install PyTorch with the right CUDA version so my GPU works?](https://discuss.pytorch.org/t/soumitra-dutta-oxford-how-do-i-install-pytorch-with-the-right-cuda-version-so-my-gpu-works/224733)

<div class="topic-metadata">

**Author:** [@soumitradutta26](https://discuss.pytorch.org/u/soumitradutta26)\
**Replies:** 2\
**Last updated:** [March 27, 2026, 12:21am UTC](https://discuss.pytorch.org/t/soumitra-dutta-oxford-how-do-i-install-pytorch-with-the-right-cuda-version-so-my-gpu-works/224733 "2026-03-27T00:21:49Z")

</div>

Hi everyone, My name is Soumitra Dutta, an Oxford-based entrepreneur & photographer. I’m trying to install PyTorch so that it works with my GPU. How do I make sure I choose the correct CUDA version? Any tips or step‑by‑s…

---

## [Getting an error while running my code on P100 GPU on Kaggle](https://discuss.pytorch.org/t/getting-an-error-while-running-my-code-on-p100-gpu-on-kaggle/224730)

<div class="topic-metadata">

**Author:** [@Wizard](https://discuss.pytorch.org/u/Wizard)\
**Replies:** 1\
**Last updated:** [March 23, 2026, 12:15pm UTC](https://discuss.pytorch.org/t/getting-an-error-while-running-my-code-on-p100-gpu-on-kaggle/224730 "2026-03-23T12:15:27Z")

</div>

Hii everyone… I am training a final laye ron the ConvNeXt\_tiny model using the CIFAR-10 and Fashion-MNIST dataset. My code was working perfectly 2 days ago on kaggle on a P100 GPU. But today it started to show this erro…

---

## [CUDA initialization: Unexpected error from cudaGetDeviceCount(),Torch.cuda.is\_available() returns False with cuda11.6 or (cuda10.2),How do I solve it?](https://discuss.pytorch.org/t/cuda-initialization-unexpected-error-from-cudagetdevicecount-torch-cuda-is-available-returns-false-with-cuda11-6-or-cuda10-2-how-do-i-solve-it/156729)

<div class="topic-metadata">

**Author:** [@LUO77123](https://discuss.pytorch.org/u/LUO77123)\
**Replies:** 11\
**Last updated:** [March 9, 2026, 9:18am UTC](https://discuss.pytorch.org/t/cuda-initialization-unexpected-error-from-cudagetdevicecount-torch-cuda-is-available-returns-false-with-cuda11-6-or-cuda10-2-how-do-i-solve-it/156729 "2026-03-09T09:18:53Z")

</div>

I created multiple environments based on Cuda10.2 and Cuda11.6 and reported the same error on the A100 card。 CUDA initialization: Unexpected error from cudaGetDeviceCount(),How do I solve it? nvidia-smi =11.6, A100 1.e…

---

## [Can I used pretrained weight for different embedding size?](https://discuss.pytorch.org/t/can-i-used-pretrained-weight-for-different-embedding-size/224650)

<div class="topic-metadata">

**Author:** [@pojan](https://discuss.pytorch.org/u/pojan)\
**Replies:** 0\
**Last updated:** [March 4, 2026, 10:45am UTC](https://discuss.pytorch.org/t/can-i-used-pretrained-weight-for-different-embedding-size/224650 "2026-03-04T10:45:42Z")

</div>

Hello, I’m new to this field and still learning. I would like to ask a question due to the pretrained weights. I’m trying to replace the conventional 3Dconv with with my custom Depthwise Separable Convolution method for…

---

## [Dataset size and k-fold strategy for CT denoising in PyTorch](https://discuss.pytorch.org/t/dataset-size-and-k-fold-strategy-for-ct-denoising-in-pytorch/224640)

<div class="topic-metadata">

**Author:** [@marcins](https://discuss.pytorch.org/u/marcins)\
**Replies:** 0\
**Last updated:** [March 2, 2026, 1:08pm UTC](https://discuss.pytorch.org/t/dataset-size-and-k-fold-strategy-for-ct-denoising-in-pytorch/224640 "2026-03-02T13:08:27Z")

</div>

Hello, I couldn’t find any information that would provide answers to my questions, and I would appreciate advice on the following project. I want to train a denoiser in PyTorch for X-ray CT reconstructions using an MSD…

---

## [Issues with Dataloader for imagenet (should I use datasets.ImageFolder or datasets.ImageNet)?](https://discuss.pytorch.org/t/issues-with-dataloader-for-imagenet-should-i-use-datasets-imagefolder-or-datasets-imagenet/115742)

<div class="topic-metadata">

**Author:** [@seyeeet](https://discuss.pytorch.org/u/seyeeet)\
**Replies:** 12\
**Last updated:** [February 25, 2026, 8:01pm UTC](https://discuss.pytorch.org/t/issues-with-dataloader-for-imagenet-should-i-use-datasets-imagefolder-or-datasets-imagenet/115742 "2026-02-25T20:01:54Z")

</div>

I want to use the pretrained models from pytorch and evaluate them on imagenet val data. That should be fairly straightforward, but I am getting stuck on the dataloader. I downloaded the imagenet and the folder structur…

---

## [How to make Cross Entropy Loss work with Cutmix & Mixup?](https://discuss.pytorch.org/t/how-to-make-cross-entropy-loss-work-with-cutmix-mixup/192342)

<div class="topic-metadata">

**Author:** [@sandrodand](https://discuss.pytorch.org/u/sandrodand)\
**Replies:** 4\
**Last updated:** [February 25, 2026, 9:29am UTC](https://discuss.pytorch.org/t/how-to-make-cross-entropy-loss-work-with-cutmix-mixup/192342 "2026-02-25T09:29:07Z")

</div>

Hi everyone, I’m trying to follow the steps of the official tutorial on how to implement both cutmix and mixup during training to perform augmentation but when I start training i get this runtime error from the criterio…

---

## [Transforms are being applied to masks for some reason](https://discuss.pytorch.org/t/transforms-are-being-applied-to-masks-for-some-reason/224568)

<div class="topic-metadata">

**Author:** [@kargneq](https://discuss.pytorch.org/u/kargneq)\
**Replies:** 1\
**Last updated:** [February 19, 2026, 10:04am UTC](https://discuss.pytorch.org/t/transforms-are-being-applied-to-masks-for-some-reason/224568 "2026-02-19T10:04:02Z")

</div>

I am doing RandomHorizontalFlip and RandomVerticalFlip, though they are being applied to the image and mask separately. import numpy as np import pandas as pd import torch from torch import nn from torch import optim f…

---

## [LLaVA Steering: Why does grounding fix hallucinations in captioning but not in Yes/No QA?](https://discuss.pytorch.org/t/llava-steering-why-does-grounding-fix-hallucinations-in-captioning-but-not-in-yes-no-qa/224569)

<div class="topic-metadata">

**Author:** [@Pulkit\_Mittal](https://discuss.pytorch.org/u/Pulkit_Mittal)\
**Replies:** 0\
**Last updated:** [February 18, 2026, 5:23pm UTC](https://discuss.pytorch.org/t/llava-steering-why-does-grounding-fix-hallucinations-in-captioning-but-not-in-yes-no-qa/224569 "2026-02-18T17:23:25Z")

</div>

Hi everyone, I am working on an inference-time steering method for LLaVA-1.5-7b to improve visual grounding. My method works by monitoring the attention layers during generation. If the model’s attention to the image fe…

---

## [Severe training slowdown after unfold-based patchification](https://discuss.pytorch.org/t/severe-training-slowdown-after-unfold-based-patchification/224502)

<div class="topic-metadata">

**Author:** [@mw-v](https://discuss.pytorch.org/u/mw-v)\
**Replies:** 5\
**Last updated:** [February 17, 2026, 11:11pm UTC](https://discuss.pytorch.org/t/severe-training-slowdown-after-unfold-based-patchification/224502 "2026-02-17T23:11:59Z")

</div>

Hi everyone, I’m training a CycleGAN and I’m facing a severe slowdown / apparent freeze when I introduce explicit patchification using torch.nn.functional.unfold. In my dataset I: Apply aligned transforms to paired i…

---

## [RPN+ROI architectiure (Faster R-CNN)](https://discuss.pytorch.org/t/rpn-roi-architectiure-faster-r-cnn/69047)

<div class="topic-metadata">

**Author:** [@sigma\_x](https://discuss.pytorch.org/u/sigma_x)\
**Replies:** 1\
**Last updated:** [February 16, 2026, 7:15pm UTC](https://discuss.pytorch.org/t/rpn-roi-architectiure-faster-r-cnn/69047 "2026-02-16T19:15:25Z")

</div>

I have a question about the architecture of RPN and ROIALign in Faster/Mask R-CNN (see the image). For each anchor in RPN there are two ‘heads’: 4 bbox values and 1 confidence value that are compared to the labels (offs…

[Next page](https://discuss.pytorch.org/c/vision/5.md?page=1)
