# torch.package / torch::deploy

**URL:** https://discuss.pytorch.org/c/torch-package-torch-deploy/34.md

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

---

## [About the torch.package / torch::deploy category](https://discuss.pytorch.org/t/about-the-torch-package-torch-deploy-category/130389)

<div class="topic-metadata">

**Author:** [@jspisak](https://discuss.pytorch.org/u/jspisak)\
**Replies:** 0

</div>

this category is focused on python deployment of PyTorch models and specifically the torch::deploy and torch.package APIs. More can be found at pytorch.org in the docs…

---

## [torch.linalg.solve singular matrix in grid\_sample backward pass with AMP on large images - all hyperparameter combinations tested](https://discuss.pytorch.org/t/torch-linalg-solve-singular-matrix-in-grid-sample-backward-pass-with-amp-on-large-images-all-hyperparameter-combinations-tested/224930)

<div class="topic-metadata">

**Author:** [@Maheronnaghsh](https://discuss.pytorch.org/u/Maheronnaghsh)\
**Replies:** 0\
**Last updated:** [May 13, 2026, 10:22am UTC](https://discuss.pytorch.org/t/torch-linalg-solve-singular-matrix-in-grid-sample-backward-pass-with-amp-on-large-images-all-hyperparameter-combinations-tested/224930 "2026-05-13T10:22:02Z")

</div>

\### Problem Summary When training a model with \`F.grid\_sample\` using \*\*Automatic Mixed Precision (AMP)\*\* on \*\*1024x1024 images\*\*, the backward pass consistently fails with: \`\`\` torch.linalg.solve: (Batch element 0): T…

---

## [RuntimeError: Unexpected error from cudaGetDeviceCount()](https://discuss.pytorch.org/t/runtimeerror-unexpected-error-from-cudagetdevicecount/139977)

<div class="topic-metadata">

**Author:** [@Samah\_Abu\_saleem](https://discuss.pytorch.org/u/Samah_Abu_saleem)\
**Replies:** 16\
**Last updated:** [February 5, 2026, 1:25pm UTC](https://discuss.pytorch.org/t/runtimeerror-unexpected-error-from-cudagetdevicecount/139977 "2026-02-05T13:25:06Z")

</div>

I was training GCN model on my Linux server and I suddenly got this error. RuntimeError: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have alrea…

---

## [Cuda and Torch install via pip vs. conda](https://discuss.pytorch.org/t/cuda-and-torch-install-via-pip-vs-conda/224360)

<div class="topic-metadata">

**Author:** [@kasus8](https://discuss.pytorch.org/u/kasus8)\
**Replies:** 5\
**Last updated:** [January 19, 2026, 2:44am UTC](https://discuss.pytorch.org/t/cuda-and-torch-install-via-pip-vs-conda/224360 "2026-01-19T02:44:06Z")

</div>

I am trying to make my repository as reproducible as possible, and after a discussion with ChatGPT I thought it would be a good idea to use conda with an environment.yml file instead of a requirements.txt. However, it do…

---

## [Urgent Help Needed: Compiling pytorch\_scatter for RTX 5070 in ComfyUI (std Ambiguous Symbol Error)](https://discuss.pytorch.org/t/urgent-help-needed-compiling-pytorch-scatter-for-rtx-5070-in-comfyui-std-ambiguous-symbol-error/222742)

<div class="topic-metadata">

**Author:** [@Da\_Harbinger](https://discuss.pytorch.org/u/Da_Harbinger)\
**Replies:** 1\
**Last updated:** [December 10, 2025, 5:25pm UTC](https://discuss.pytorch.org/t/urgent-help-needed-compiling-pytorch-scatter-for-rtx-5070-in-comfyui-std-ambiguous-symbol-error/222742 "2025-12-10T17:25:03Z")

</div>

I’m trying to compile pytorch\_scatter to run the Hunyuan3D node in ComfyUI on Windows, targeting my NVIDIA RTX 5070 (Blackwell, sm\_120). Despite multiple attempts, I keep hitting a std ambiguous symbol error in compiled\_…

---

## [Buffer Overflow resolution](https://discuss.pytorch.org/t/buffer-overflow-resolution/223623)

<div class="topic-metadata">

**Author:** [@tm-kachi](https://discuss.pytorch.org/u/tm-kachi)\
**Replies:** 3\
**Last updated:** [October 30, 2025, 1:58pm UTC](https://discuss.pytorch.org/t/buffer-overflow-resolution/223623 "2025-10-30T13:58:29Z")

</div>

I saw that 2.7.0 had a Buffer Overflow vulnerability outlined here https://www.cvedetails.com/cve/CVE-2025-55558/. Upgraded to 2.9.0 but vulnerability wasn’t fixed. Wondering if this would be resolved soon?

---

## [No module named cv2 although opencv has been installed already](https://discuss.pytorch.org/t/no-module-named-cv2-although-opencv-has-been-installed-already/223297)

<div class="topic-metadata">

**Author:** [@Casey\_KimScripts](https://discuss.pytorch.org/u/Casey_KimScripts)\
**Replies:** 6\
**Last updated:** [October 9, 2025, 8:27am UTC](https://discuss.pytorch.org/t/no-module-named-cv2-although-opencv-has-been-installed-already/223297 "2025-10-09T08:27:31Z")

</div>

I wanted to try the simple code which was supposed to convert text to video like this import cv2 import numpy as np cap = cv2.VideoCapture(0) #more lines of code follow I tried moving cv2.so around in my source code …

---

## [RuntimeError: expected scalar type Float but found BFloat16](https://discuss.pytorch.org/t/runtimeerror-expected-scalar-type-float-but-found-bfloat16/220757)

<div class="topic-metadata">

**Author:** [@Federico\_Ottomano](https://discuss.pytorch.org/u/Federico_Ottomano)\
**Replies:** 1\
**Last updated:** [June 12, 2025, 5:28pm UTC](https://discuss.pytorch.org/t/runtimeerror-expected-scalar-type-float-but-found-bfloat16/220757 "2025-06-12T17:28:56Z")

</div>

I’m running my model in bf16-mixed precision and encountering the following error: RuntimeError: expected scalar type Float but found BFloat16 This happens when I apply an nn.TransformerEncoder model to my data. My in…

---

## [\_scaled\_dot\_product\_efficient\_attention implementation](https://discuss.pytorch.org/t/scaled-dot-product-efficient-attention-implementation/220407)

<div class="topic-metadata">

**Author:** [@arunava5764](https://discuss.pytorch.org/u/arunava5764)\
**Replies:** 0\
**Last updated:** [May 28, 2025, 1:46pm UTC](https://discuss.pytorch.org/t/scaled-dot-product-efficient-attention-implementation/220407 "2025-05-28T13:46:53Z")

</div>

I was profiling a ViT model using pytorch profiler. It shows “\_scaled\_dot\_product\_efficient\_attention” function called 12 times. I want to see the implementation of this function in pytorch github repo. The function name…

---

## [RuntimeError: Unexpected error from cudaGetDeviceCount(); Error 802: system not yet initialized](https://discuss.pytorch.org/t/runtimeerror-unexpected-error-from-cudagetdevicecount-error-802-system-not-yet-initialized/219320)

<div class="topic-metadata">

**Author:** [@nfarisha](https://discuss.pytorch.org/u/nfarisha)\
**Replies:** 1\
**Last updated:** [April 22, 2025, 12:23pm UTC](https://discuss.pytorch.org/t/runtimeerror-unexpected-error-from-cudagetdevicecount-error-802-system-not-yet-initialized/219320 "2025-04-22T12:23:58Z")

</div>

Hi all, I’m trying to set up the environment for CUDA before importing torch, but I’m running into the following error: RuntimeError: Unexpected error from cudaGetDeviceCount(). Did you run some CUDA functions before c…

---

## [Need guidance on pytorch dependency size reduction inside docker image using nvidia-container-toolkit](https://discuss.pytorch.org/t/need-guidance-on-pytorch-dependency-size-reduction-inside-docker-image-using-nvidia-container-toolkit/218091)

<div class="topic-metadata">

**Author:** [@mithun](https://discuss.pytorch.org/u/mithun)\
**Replies:** 4\
**Last updated:** [April 1, 2025, 2:53am UTC](https://discuss.pytorch.org/t/need-guidance-on-pytorch-dependency-size-reduction-inside-docker-image-using-nvidia-container-toolkit/218091 "2025-04-01T02:53:24Z")

</div>

Dear All, Greetings. I need to containerise an AI/ML module which is prgrammed to use following: model: huggingface bge-v2-m3 reranker needed dependency: torch (pytorch) hardware: nvidia GPU format: container based …

---

## [Missing Torch Version](https://discuss.pytorch.org/t/missing-torch-version/217152)

<div class="topic-metadata">

**Author:** [@Michael\_Sh](https://discuss.pytorch.org/u/Michael_Sh)\
**Replies:** 1\
**Last updated:** [March 3, 2025, 9:16am UTC](https://discuss.pytorch.org/t/missing-torch-version/217152 "2025-03-03T09:16:01Z")

</div>

Hi all, First of all, I want to thank you for the amazing library! I’m currently trying to find a binary version that meets the following specifications: torch==2.5.1 CUDA version: 12.4 Architecture: ARM 7.5 for Gravi…

---

## [cuDNN error: CUDNN\_STATUS\_EXECUTION\_FAILED \[use L40s\]](https://discuss.pytorch.org/t/cudnn-error-cudnn-status-execution-failed-use-l40s/217140)

<div class="topic-metadata">

**Author:** [@ckku841023](https://discuss.pytorch.org/u/ckku841023)\
**Replies:** 2\
**Last updated:** [February 26, 2025, 11:39am UTC](https://discuss.pytorch.org/t/cudnn-error-cudnn-status-execution-failed-use-l40s/217140 "2025-02-26T11:39:26Z")

</div>

I have a program for model training and inference that relies on many customized functions, which must be executed in a pytorch1.5.0+cu9.2 environment. I set up an Ubuntu 18.04 environment in the cloud with an L40s GPU. …

---

## [Clarification on NVIDIA License Compliance for Using PyTorch (torch)](https://discuss.pytorch.org/t/clarification-on-nvidia-license-compliance-for-using-pytorch-torch/215374)

<div class="topic-metadata">

**Author:** [@Garvit\_Mathur](https://discuss.pytorch.org/u/Garvit_Mathur)\
**Replies:** 0\
**Last updated:** [January 14, 2025, 1:24pm UTC](https://discuss.pytorch.org/t/clarification-on-nvidia-license-compliance-for-using-pytorch-torch/215374 "2025-01-14T13:24:32Z")

</div>

Hi PyTorch Team, In our organization, we are trying to install PyTorch (torch) via PyPI. However, our compliance tools are flagging a potential vulnerability due to the NVIDIA license included with the package. We under…

---

## [Installing Torch globally on Linux/Ubuntu](https://discuss.pytorch.org/t/installing-torch-globally-on-linux-ubuntu/215022)

<div class="topic-metadata">

**Author:** [@RubixCube](https://discuss.pytorch.org/u/RubixCube)\
**Replies:** 0\
**Last updated:** [January 6, 2025, 11:42am UTC](https://discuss.pytorch.org/t/installing-torch-globally-on-linux-ubuntu/215022 "2025-01-06T11:42:39Z")

</div>

Hello all, I have a small question regarding installing Torch on Linux, in particular on Ubuntu/Ubuntu-based distributions. It’s mostly a Python/pip management question, still strongly related to Torch, thus I think it’…

---

## [Error while while trying to train Tactron2 with a gpu](https://discuss.pytorch.org/t/error-while-while-trying-to-train-tactron2-with-a-gpu/212630)

<div class="topic-metadata">

**Author:** [@AndreeaV\_13003](https://discuss.pytorch.org/u/AndreeaV_13003)\
**Replies:** 1\
**Last updated:** [November 6, 2024, 7:34pm UTC](https://discuss.pytorch.org/t/error-while-while-trying-to-train-tactron2-with-a-gpu/212630 "2024-11-06T19:34:43Z")

</div>

Hi.I’ve been trying to train the Tacotron2 model for some time and an error keeps apearing.I don’t really know what to do .Please help This is the error that i am getting: RuntimeError: CUDA error: device-side assert t…

---

## [How can I change nccl version in pytorch?](https://discuss.pytorch.org/t/how-can-i-change-nccl-version-in-pytorch/143942)

<div class="topic-metadata">

**Author:** [@ddoron9](https://discuss.pytorch.org/u/ddoron9)\
**Replies:** 18\
**Last updated:** [October 29, 2024, 7:25pm UTC](https://discuss.pytorch.org/t/how-can-i-change-nccl-version-in-pytorch/143942 "2024-10-29T19:25:52Z")

</div>

hi I’m using cuda 11.3 and if I run multi-gpus it freezes so I thought it would be solved if I change pytorch.cuda.nccl.version… also is there any way to find nccl 2.10.3 in my env? because apt search nccl didn’t show a…

---

## [Tensor.numpy() not working when PyTorch running on docker container](https://discuss.pytorch.org/t/tensor-numpy-not-working-when-pytorch-running-on-docker-container/211877)

<div class="topic-metadata">

**Author:** [@x.projekt](https://discuss.pytorch.org/u/x.projekt)\
**Replies:** 1\
**Last updated:** [October 21, 2024, 6:27pm UTC](https://discuss.pytorch.org/t/tensor-numpy-not-working-when-pytorch-running-on-docker-container/211877 "2024-10-21T18:27:47Z")

</div>

Trying to run Stability AI’s SDXL-base-1.0 in a docker container. The following code snippet loads the model into memory: base = DiffusionPipeline.from\_pretrained( "stabilityai/stable-diffusion-xl-base-1.0"…

---

## [Creating a PyTorch model to fit a curve](https://discuss.pytorch.org/t/creating-a-pytorch-model-to-fit-a-curve/206783)

<div class="topic-metadata">

**Author:** [@A\_mour](https://discuss.pytorch.org/u/A_mour)\
**Replies:** 2\
**Last updated:** [July 24, 2024, 4:47am UTC](https://discuss.pytorch.org/t/creating-a-pytorch-model-to-fit-a-curve/206783 "2024-07-24T04:47:49Z")

</div>

import torch import matplotlib matplotlib.use(‘TkAgg’) import matplotlib.pyplot as plt from torch import nn import os import numpy as np 从文件中加载数据 def load\_data\_from\_file(file\_path): if not os.path.isfile(file\_pat…

---

## [RuntimeError: stack expects each tensor to be equal size, but got \[1, 1024, 1024\] at entry 0 and \[4, 1024, 1024\] at entry 1 Collate error on the key 'fixed\_image' of dictionary data. MONAI hint: if your transforms intentionally create images of different](https://discuss.pytorch.org/t/runtimeerror-stack-expects-each-tensor-to-be-equal-size-but-got-1-1024-1024-at-entry-0-and-4-1024-1024-at-entry-1-collate-error-on-the-key-fixed-image-of-dictionary-data-monai-hint-if-your-transforms-intentionally-create-images-of-different/205706)

<div class="topic-metadata">

**Author:** [@Hassan\_Ghavidel](https://discuss.pytorch.org/u/Hassan_Ghavidel)\
**Replies:** 6\
**Last updated:** [July 5, 2024, 9:02pm UTC](https://discuss.pytorch.org/t/runtimeerror-stack-expects-each-tensor-to-be-equal-size-but-got-1-1024-1024-at-entry-0-and-4-1024-1024-at-entry-1-collate-error-on-the-key-fixed-image-of-dictionary-data-monai-hint-if-your-transforms-intentionally-create-images-of-different/205706 "2024-07-05T21:02:22Z")

</div>

I am doing a project about image registration. received this error: Epoch 0/99: 33%|████████████████████████████████████████████████████████████████████████▎ …

---

## [PyTorch 0.3.1 Code to Latest Version of Ubuntu and GPU?](https://discuss.pytorch.org/t/pytorch-0-3-1-code-to-latest-version-of-ubuntu-and-gpu/202923)

<div class="topic-metadata">

**Author:** [@jamesjang26](https://discuss.pytorch.org/u/jamesjang26)\
**Replies:** 1\
**Last updated:** [May 17, 2024, 12:48pm UTC](https://discuss.pytorch.org/t/pytorch-0-3-1-code-to-latest-version-of-ubuntu-and-gpu/202923 "2024-05-17T12:48:46Z")

</div>

Hello PyTorch Community, I am currently working on a research project that involves an old model developed using PyTorch 0.3.1. Given the advancements in hardware and software, I need to update this model to run on my m…

---

## [Runtime Error on local rank using torch library](https://discuss.pytorch.org/t/runtime-error-on-local-rank-using-torch-library/202338)

<div class="topic-metadata">

**Author:** [@SRK195](https://discuss.pytorch.org/u/SRK195)\
**Replies:** 0\
**Last updated:** [May 8, 2024, 5:52am UTC](https://discuss.pytorch.org/t/runtime-error-on-local-rank-using-torch-library/202338 "2024-05-08T05:52:09Z")

</div>

I am trying to finetune the llama model using the torch library with the cmd - tune run lora\_finetune\_single\_device --config llama2/7B\_lora\_single\_device epochs=1 I get an Error - “RuntimeError: The local rank is large…

---

## [\--index-url to install pytorch](https://discuss.pytorch.org/t/index-url-to-install-pytorch/198253)

<div class="topic-metadata">

**Author:** [@JuanFMontesinos](https://discuss.pytorch.org/u/JuanFMontesinos)\
**Replies:** 3\
**Last updated:** [April 30, 2024, 2:21pm UTC](https://discuss.pytorch.org/t/index-url-to-install-pytorch/198253 "2024-04-30T14:21:08Z")

</div>

Hi everyone, I was wondering why pytorch is installed relying on custom repositories with pip. Pytorch must be installed as: pip install torch --index-url https://download.pytorch.org/whl/cu121 There different reposi…

---

## [Tried to do real simple nn.Linear model from scratch forward() is not giving correct answer](https://discuss.pytorch.org/t/tried-to-do-real-simple-nn-linear-model-from-scratch-forward-is-not-giving-correct-answer/200948)

<div class="topic-metadata">

**Author:** [@GGPYTORCH000](https://discuss.pytorch.org/u/GGPYTORCH000)\
**Replies:** 2\
**Last updated:** [April 16, 2024, 1:51am UTC](https://discuss.pytorch.org/t/tried-to-do-real-simple-nn-linear-model-from-scratch-forward-is-not-giving-correct-answer/200948 "2024-04-16T01:51:38Z")

</div>

i wrote small class Linear which is similar to nn.Linear interms of initialization and forwarding. It worked however when I switched my code from nn.Linear to my own Linear, forward compute is not giving correct result. …

---

## [How to make the GCN output to be of binary type](https://discuss.pytorch.org/t/how-to-make-the-gcn-output-to-be-of-binary-type/200137)

<div class="topic-metadata">

**Author:** [@ElenaRz](https://discuss.pytorch.org/u/ElenaRz)\
**Replies:** 0\
**Last updated:** [April 3, 2024, 4:08am UTC](https://discuss.pytorch.org/t/how-to-make-the-gcn-output-to-be-of-binary-type/200137 "2024-04-03T04:08:00Z")

</div>

Hello. I am very new in PyTorch graph Neural Network. I have multiple graphs and I want to do node classification. I divided the graphs to 80% of them for training and 10% for evaluation and 10% for testing. I tried to u…

---

## [Have some problem with cuda](https://discuss.pytorch.org/t/have-some-problem-with-cuda/164974)

<div class="topic-metadata">

**Author:** [@Abdelkareem\_Elkhateb](https://discuss.pytorch.org/u/Abdelkareem_Elkhateb)\
**Replies:** 2\
**Last updated:** [November 1, 2022, 11:27pm UTC](https://discuss.pytorch.org/t/have-some-problem-with-cuda/164974 "2022-11-01T23:27:35Z")

</div>

I am running cuda with pytorch 1.12 and gpu is not configured . i installed pytorch with cuda driver conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge

---

## [After nvidia driver update cuda is disabled](https://discuss.pytorch.org/t/after-nvidia-driver-update-cuda-is-disabled/198368)

<div class="topic-metadata">

**Author:** [@ddoron9](https://discuss.pytorch.org/u/ddoron9)\
**Replies:** 4\
**Last updated:** [March 7, 2024, 5:22am UTC](https://discuss.pytorch.org/t/after-nvidia-driver-update-cuda-is-disabled/198368 "2024-03-07T05:22:27Z")

</div>

hi, I’ve updated my old driver. after that torch cuda is disabled with this error code. Is there any way to know where the issue came from? Please give any tips. below is my current cuda versions. python3 Python 3.11.5…

---

## [An error occurred when I try to initialize a member of the subclass of nn.Module](https://discuss.pytorch.org/t/an-error-occurred-when-i-try-to-initialize-a-member-of-the-subclass-of-nn-module/197860)

<div class="topic-metadata">

**Author:** [@BaeHann](https://discuss.pytorch.org/u/BaeHann)\
**Replies:** 2\
**Last updated:** [February 29, 2024, 5:07am UTC](https://discuss.pytorch.org/t/an-error-occurred-when-i-try-to-initialize-a-member-of-the-subclass-of-nn-module/197860 "2024-02-29T05:07:12Z")

</div>

Hi ,everyone. After I initialized the following class, no attribute can be found in the initialized member, let alone the subsequent training process. However, if I erase the nn.Module, not setting the InceptionTime as …

---

## [GAT edge features Assertion Error](https://discuss.pytorch.org/t/gat-edge-features-assertion-error/170049)

<div class="topic-metadata">

**Author:** [@jimmy1](https://discuss.pytorch.org/u/jimmy1)\
**Replies:** 2\
**Last updated:** [February 18, 2024, 7:20pm UTC](https://discuss.pytorch.org/t/gat-edge-features-assertion-error/170049 "2024-02-18T19:20:06Z")

</div>

Hi, I am having issues with implementing a GAT model. The model runs when I dont have edge features, but once I had edge\_attr into the GATConv layers I get the following error. Traceback (most recent call last): File …

---

## [Model based on transformer does not reach a fine result in very basic application](https://discuss.pytorch.org/t/model-based-on-transformer-does-not-reach-a-fine-result-in-very-basic-application/196670)

<div class="topic-metadata">

**Author:** [@david\_villota](https://discuss.pytorch.org/u/david_villota)\
**Replies:** 0\
**Last updated:** [February 5, 2024, 5:01pm UTC](https://discuss.pytorch.org/t/model-based-on-transformer-does-not-reach-a-fine-result-in-very-basic-application/196670 "2024-02-05T17:01:49Z")

</div>

Hi there!, I am trying to develop an algorithm that given an speed limit and height profile yields the most efficient speed. I am planning on trying reinforcement learning in a later stage to get the optimal point but …

[Next page](https://discuss.pytorch.org/c/torch-package-torch-deploy/34.md?page=1)
