684 questions
0
votes
0
answers
70
views
Torchvision save segmentation masks to png
There is a tutorial i try to follow https://docs.pytorch.org/tutorials/intermediate/torchvision_tutorial.html
working with .png files as segmentation masks.
The png files can be found here:
https://...
0
votes
2
answers
121
views
Rotation with Pytorch Torchvision but from two specific angles
I want to randomly rotate my images at 45 degrees or -45 degrees, but only these two, no in between. 50% chances for 45 and 50% for -45.
I know that I can use RandomRotation of torchvision, but if I ...
1
vote
2
answers
123
views
How do I train an object detection model using Torchvision's pre-trained models?
I read the torchvision API documentation using pre-trained models for object detection. This is an example they have included:
from torchvision.io.image import decode_image
from torchvision.models....
0
votes
0
answers
35
views
S3 Torchconnector and Image Transformations for training an Image-based ML model
Using AWS Sagemaker I implemented the S3torchconnector to be able to connect between my datasets stored in an S3 bucket and PyTorch. However, there seems to be an issue with the 'transform' parameter ...
1
vote
0
answers
54
views
Error importing torchmetrics using Pycharm/venv
I've installed torchmetrics in a venv with Pycharm, but every time I try to import it or anything from it I get this error:
Traceback (most recent call last):
File "C:\Users\mango\...
0
votes
1
answer
66
views
Using Torchvison ImageFolder on AWS S3
I'm working with an AWS S3 instance and trying to deploy a SSL model loading a dataset from a bucket list I have defined on S3. The DL framework I'm using is PyTorch and more concretely to load the ...
1
vote
1
answer
140
views
Stable Diffusion WebUI Torch Installation Error: [WinError 32] File in Use by Another Process
I'm trying to run Stable Diffusion WebUI (v1.10.1) on Windows using the built-in launch.py script. However, during the environment setup, it fails to install torch==2.1.2 and torchvision==0.16.2.
Here ...
3
votes
0
answers
5k
views
"UserWarning: 'pin_memory' argument is set as true but no accelerator is found, then device pinned memory won't be used."
I am trying to use EasyOCR,
reader = easyocr.Reader(['en'], gpu=False)
def read_sign(sign):
result = reader.readtext(sign)
return 'STOP' in result`
However while it did work at the start, it ...
1
vote
0
answers
79
views
Pytorch - torchvision model getting different results in python and kotlin
I have a torchvision model which is mobilenet without the classification head to use as a similarity search. I have saved it as a torchvision model. When I use it within python with the similarity ...
1
vote
0
answers
262
views
Error while installing transformer_engine
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for transformer_engine
Running setup.py clean for ...
0
votes
1
answer
125
views
Problem with MaskRCNN ("NotImplementedError") which seems to be related to torchvision.transforms.v2._transform
I am learning MaskRCNN and to this end, I startet to follow this tutorial step by step.
Everything is working fine until I reach the block entitled "Test the transforms" which reads
# ...
0
votes
0
answers
84
views
Force TouchDesigner to use a specific python version
I'm running Windows10.
For my project I have to use Python 3.10 with tensorflow-directml, torchvision and other deep learning tools.
The following is a link to one of the many guides about this topic:
...
0
votes
1
answer
46
views
train and validation metrics and loss using torchvision
I am new to pytorch and torchvision.
Apparently, the __call__ method of a model returns different things if they are on train mode or not. The first case returns the loss, the second returns the ...
0
votes
1
answer
42
views
Torchvision v2 joint transform
Torchvision transforms v2 promises to apply transform to both inputs similarly, however that doesn't seem to happen:
import torchvision.transforms.v2 as transforms_v2
joint_transform = transforms_v2....
0
votes
1
answer
133
views
Equivalent of _new_empty_tensor from torchvision in pure torch function
I am trying to use a vision transformer repository (https://github.com/wangjian123799/L-DETR) which uses a version of torch and torchvision. Anyway, because exact versions are not given and torch is ...
0
votes
0
answers
79
views
Why py-torchvision fails on FresBSD 14 with "RuntimeError: operator torchvision::nms does not exist"?
While trying to import:
import torchvision.models as models
I get the following runtime error:
---------------------------------------------------------------------------
RuntimeError ...
2
votes
1
answer
103
views
Does order of transforms applied for data augmentation matter in Torchvision transforms?
I have the following Custom dataset class for an image segmentation task.
class LoadDataset(Dataset):
def __init__(self, img_dir, mask_dir, apply_transforms = None):
self.img_dir = img_dir
...
0
votes
1
answer
167
views
Turn Grayscale mask-image into RGB while changing one grayscale into specific color
While using torch and matplotlib I was able to change the grayscale color #50 e.g. to red. However, only by saving the image inbetween.
How can it be solved without saving the image?
I am sorry for ...
0
votes
0
answers
743
views
Conflicting dependencies while installing torch==1.10.0, torchaudio==0.10.0, and torchvision==0.11.0 in my Python environment
I'm having trouble installing the following dependencies in my Python environment:
torch==1.10.0+cpu
torchaudio==0.10.0
torchvision==0.11.0
pyannote-audio==0.0.1
lightning==2.3.3
numpy
scipy
pandas
...
1
vote
1
answer
64
views
OutOfMemoryError: CUDA out of memory with a gan
I have been trying to setup this gan but i cannot escape this error: https://pastebin.com/rp0kNXiH (sometimes it's not the same line)
I have tried gc.collect but maybe i misplaced it. I also tried to ...
0
votes
0
answers
100
views
RuntimeError to obtain ImageNet dataset from torchvision.datasets: ILSVRC2012_devkit_t12.tar.gz is not present in the root directory or is corrupted
Given:
import os
from torchvision.datasets import ImageNet
from torch.utils.data import DataLoader
train_dataset = ImageNet(
root=os.path.expanduser("~/.cache"),
split='train',
...
1
vote
0
answers
116
views
cannot import name 'OpOverload' from 'torch._ops'
when i run a cell contain
from torchvision import datasets,transforms
and an error appears.
---------------------------------------------------------------------------
ImportError ...
0
votes
0
answers
31
views
Celery tasks and Torch multiprocessing
I have a script with neural networks here is example of init
import torch
from torchvision.models.detection import fasterrcnn_resnet50_fpn
from torchvision.models.detection import ...
0
votes
0
answers
51
views
Count number of trainable parameters from model start to given layer
I have a number of pytorch models and would like to print the number of trainable parameters it took to get to specific points in the feed forward function.
I know how get the number of all trainable ...
0
votes
1
answer
49
views
What should be my classifier in Transfer Learning using MaxViT?
I am trying to do transfer learning on Pytorch pretrained models with custom dataset. I have been able to successfully perform transfer learning with SqueezeNet.
For Squeezenet my classifier was, ...
0
votes
0
answers
174
views
TypeError: empty() received an invalid combination of arguments
I want to do object detection using cascade r-cnn and swin transformer. Here is my code and the libraries I installed.
mmcv 2.1.0
mmdet 3.3.0 ...
0
votes
0
answers
620
views
Is torch2.4.1 compatible with CUDA 12.5?
I locally installed my CUDA Toolkit 12.5. And everything went well (I can successfully call torch.cuda.is_available() and returns true) before I install torchvision with cmd conda install torchvision -...
0
votes
0
answers
92
views
Compatibility Issue with torch_scatter
I use Torch 2.4.1, Torchvision 0.19.1, and CUDA 11.8 for my model. Torch-scatter 2.12, which I have already installed, is incompatible with these. How can I determine which version is suitable?
I want ...
1
vote
0
answers
38
views
How to display meaningful names for intermediate operations in PyTorch computational graph visualization?
I'm trying to visualize the computational graph of my PyTorch model using torchviz. I want the nodes in the graph to display meaningful names for the intermediate computations. However, the graph only ...
-1
votes
1
answer
157
views
How to implement .pth model on real-time?
I had trained the model from (here) and now, i want to implement it on real-time on my laptop. I tried several ways to load the model, but to no avail.
The code:
import cv2
import torch
import ...
0
votes
1
answer
16
views
torchsummary.summary for detection models
Failed to get a summary on a pre-trained detection torchvision model (fasterrcnn_resnet50_fpn) while it is working fine on a classification model. Is there a workaround to get the summary.
0
votes
1
answer
1k
views
pytorchvideo.transforms.RandAugment import error
I am trying to run from pytorchvideo.transforms import RandAugment in Python, but it returns the following error:
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'
I can ...
1
vote
0
answers
2k
views
Platform support for Expandable Segments in PYTORCH_CUDA_ALLOC_CONF
Apps using torch keep telling me "Expandable Segments not supported on this platform" (namely, EasyDiffusion and EasyTraining GUIs), but I couldn't find anything about the support of this ...
0
votes
1
answer
223
views
What is the preferred way to load images from s3 into torch serve for inference?
I have an image classifier model that I plan to deploy via torch serve. My question is, what is the ideal way to load as well write images from / to s3 buckets instead of from local filesystem for ...
0
votes
0
answers
90
views
Torchvision, detection inference on very large images
I trained a Mask R-CNN model from TorchVision to detect/segment a class of object. I trained the model on 512x512 patches/crops, but now I need to apply it on VERY big images (50Kx50K).
Is there a ...
1
vote
0
answers
62
views
CNN - LSTM Model (Time Sequential Video Frame Data)
During training, I use videos consisting of 16,000 frames, processing them in batches of 200 frames each for the model. For each dataset, I achieve values close to the actual data at the end of ...
0
votes
1
answer
99
views
When calling torchvision.transforms.Normalize and converting to PIL.Image, how are values above 1 handled?
Applying torchvision.Normalize should lead to values below 0 and above 1, and thus below 0 and 255 when switching to integer values.
However, when watching the values, this seems NOT to be the case. ...
0
votes
1
answer
449
views
`AttributeError` constructing `torchvision.io.VideoReader` in Google Colab
I'm trying to write a program that will use torchvision.io.VideoReader to extract a number of still images from a set of video files. This program is expected to run on Google Colab. Unfortunately, ...
0
votes
1
answer
244
views
Why is my image tensor output all zeros after processing with Spatial Transformer Network Pytorch?
I am working on a small project involving a Spatial Transformer Network (STN) to process images. I accidentally uploaded a branch with untested code, and now I'm facing an issue where my image tensor ...
1
vote
0
answers
97
views
torchvision models produce different outputs in eval mode when the batch size is different
With torchvision models, I found that different batch sizes produce slightly different outputs, even in eval mode.
At the first time, I found with example of torchvision.models.efficientnet_v2_s.
And ...
3
votes
1
answer
6k
views
RuntimeError: Numpy is not availableL Using numpy with torch [duplicate]
When I run my script that uses torch I get the following error:
File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\torchvision\transforms\functional.py", line ...
2
votes
3
answers
3k
views
torchvision::nms does not exist
Im trying to run the llama3 models using nf4 data format on cpu using intel extension . I download the pytorch from https://github.com/pytorch/pytorch and use the following command to compile: DEBUG=1 ...
0
votes
0
answers
111
views
No bounding boxes generated for a trained YOLO NAS model using Pytorch
I have trained a YOLO NAS-s format model for image detection in a retail store using pytorch. I trained my model for approx ~8000 images, 20 epochs as per below training code. Due to memory issues my ...
1
vote
1
answer
1k
views
VideoReader on torchvision on Kaggle outputs AttributeError: 'av.audio.codeccontext.AudioCodecContext' object has no attribute 'average_rate'
I'm simply trying to read a video with torchvision's VideoReader on a Kaggle notebook.
Unfortunately, I'm getting the following error:
I thought it might be related with the libs versions, so I set ...
0
votes
2
answers
2k
views
Not able to install stable diffusion , getting this error
venv "C:\sd\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.9.3
Commit hash: <hash>
...
14
votes
2
answers
10k
views
UserWarning: Plan failed with a cudnnException: CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR
I'm trying to train a model with Yolov8. Everything was good but today I suddenly notice getting this warning apparently related to PyTorch and cuDNN. In spite the warning, the training seems to be ...
1
vote
1
answer
549
views
PyTorch DataLoader hangs when num_workers > 0 with custom torchvision transform
I’m using PyTorch’s DataLoader to load my dataset. I’ve noticed that my program hangs indefinitely during training when I set num_workers > 0. However, it works fine when num_workers = 0.
Here’s a ...
4
votes
4
answers
6k
views
PyTorch RuntimeError: device >= 0 && device < num_gpus INTERNAL ASSERT FAILED
I'm trying to perform some inference with YOLOv8 models, simply using the following command:
yolo detect predict source=input.jpg model=yolov8n.pt device=0
But I'm getting this error related to ...
4
votes
4
answers
13k
views
"C:\torch\lib\fbgemm.dll" or one of its dependencies
OSError: [WinError 126] The specified module could not be found. Error loading "C:\apps\python\lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.
System information:
...
2
votes
1
answer
8k
views
What do these TORCH_USE_CUDA_DSA and frozen_modules errors mean and how to fix them?
I'm trying to run a Mask R-CNN model with aerial imagery. To optimise this, I run everything with CUDA. But this creates a few errors. Here is my code:
# Python
import torch
import torchvision
from ...