id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_79863207 | stackoverflow | MACHINE_LEARNING | Onnx cannot be read with Microsoft.ML on Windows 10 (19045.5854) | Onnx cannot be read with Microsoft.ML on Windows 10 (19045.5854)
Everything I describe here works perfectly fine on my computer that has Windows 11 (Version 10.0.26200). However, on a computer that has Windows 10 (10.0.19045), it does not work. This is a client's computer that I cannot update. I'm at a loss as to what... | https://stackoverflow.com/questions/79863207/onnx-cannot-be-read-with-microsoft-ml-on-windows-10-19045-5854 | c#, windows, pytorch, onnx | 1,767,869,174 |
se_79852317 | stackoverflow | MACHINE_LEARNING | Why does ty complain about invalid method override for Lightning Callback hooks? | Why does ty complain about invalid method override for Lightning Callback hooks?
I’m using PyTorch Lightning and trying to implement a simple callback. The code works at runtime, but the ty type checker reports invalid-method-override errors for on_train_start and on_train_end.
callbacks.py
from lightning.pytorch.call... | https://stackoverflow.com/questions/79852317/why-does-ty-complain-about-invalid-method-override-for-lightning-callback-hooks | pytorch, callback, pytorch-lightning | 1,766,331,686 |
se_79860738 | stackoverflow | MACHINE_LEARNING | Issue with converting mobile_sam.pt to onnx format (decode part) | Issue with converting mobile_sam.pt to onnx format (decode part)
I want to use the mobile_sam.pt model in web browser, so I need the onnx format of that.
I tried these method, but always getting the same error.
segment-anything -
samexporter
The error above occurred when calling torch.export.export. If you would like ... | https://stackoverflow.com/questions/79860738/issue-with-converting-mobile-sam-pt-to-onnx-format-decode-part | pytorch, onnx, sam | 1,767,613,903 |
se_79860100 | stackoverflow | MACHINE_LEARNING | NeMo ASR: ModuleNotFoundError 'ctc_decoders' when changing decoding strategy to Beam Search in Google Colab | NeMo ASR: ModuleNotFoundError 'ctc_decoders' when changing decoding strategy to Beam Search in Google Colab
I am working with NVIDIA NeMo's ASR collection (QuartzNet model) in Google Colab. I am trying to evaluate the model using CTC Beam Search without a Language Model (setting alpha=0.0).
Even after installi... | https://stackoverflow.com/questions/79860100/nemo-asr-modulenotfounderror-ctc-decoders-when-changing-decoding-strategy-to | python, pytorch, google-colaboratory, speech-recognition | 1,767,523,255 |
se_65045558 | stackoverflow | MACHINE_LEARNING | Incompletable PyTorch with any CUDA version (module 'torch' has no attribute 'cuda') | Incompletable PyTorch with any CUDA version (module 'torch' has no attribute 'cuda')
I have NVidia 1080TI, Ubuntu x64, and Python 3.6.9 installed.
I was trying to launch PyTorch with command
import torch
print(torch.cuda.is_available)
and expected to see 'True' but met the error:
AttributeError: modul... | https://stackoverflow.com/questions/65045558/incompletable-pytorch-with-any-cuda-version-module-torch-has-no-attribute-cu | python, pytorch | 1,606,526,818 |
se_79841186 | stackoverflow | MACHINE_LEARNING | HRNet trained from scratch on MPII high PCKh but poor visual predictions | HRNet trained from scratch on MPII high PCKh but poor visual predictions
I'm training an HRNet model from scratch on the MPII dataset for human pose estimation. The model succeded to get high accuracy around 0.93 PCKh@0.2 however the visual results are not really promising. for example, if we look at result of image f... | https://stackoverflow.com/questions/79841186/hrnet-trained-from-scratch-on-mpii-high-pckh-but-poor-visual-predictions | pytorch, pose-estimation | 1,765,212,932 |
se_78331842 | stackoverflow | MACHINE_LEARNING | How to install pip install torch==2.1.2+cu118 in linux? | How to install pip install torch==2.1.2+cu118 in linux?
I see some people can install pip install torch==2.1.2+cu118 e.g.,:
https://github.com/stanfordnlp/dspy/discussions/818
aiohttp==3.9.3
aioprometheus==23.12.0
aiosignal==1.3.1
alembic==1.13.1
annotated-types==0.6.0
anyio==4.3.0
attrs==23.2.0
backoff==2.2.1
certifi... | https://stackoverflow.com/questions/78331842/how-to-install-pip-install-torch-2-1-2cu118-in-linux | pytorch, huggingface-transformers, dspy, vllm | 1,713,234,970 |
se_79857308 | stackoverflow | MACHINE_LEARNING | What are the advance steps required in model training and how can i do does? | What are the advance steps required in model training and how can i do does?
I am training a model using pytorch using a NVIDIA GPU. The time taken to run and evaluate a single epoch is about 1 hour, what should i do about this, and simillarly, what are the further steps i need to do to completly develop the model lik... | https://stackoverflow.com/questions/79857308/what-are-the-advance-steps-required-in-model-training-and-how-can-i-do-does | optimization, deep-learning, pytorch, gpu | 1,767,078,396 |
se_79856699 | stackoverflow | MACHINE_LEARNING | How to preprocess and train a binary classifier on cat/dog images using logistic regression in PyTorch? | How to preprocess and train a binary classifier on cat/dog images using logistic regression in PyTorch?
Body:
I'm trying to build a binary image classifier (cat vs dog) using logistic regression in PyTorch.
Background:
I previously implemented softmax classification on MNIST: https://github.com/jeehoo0507/Mnist-softm... | https://stackoverflow.com/questions/79856699/how-to-preprocess-and-train-a-binary-classifier-on-cat-dog-images-using-logistic | python, deep-learning, pytorch | 1,767,003,733 |
se_79856399 | stackoverflow | MACHINE_LEARNING | Weird PyTorch Error in Distributed Training on Multiple GPUs - RuntimeError: Expected all tensors to be on the same device but found at least 2 device | Weird PyTorch Error in Distributed Training on Multiple GPUs - RuntimeError: Expected all tensors to be on the same device but found at least 2 device
I am attempting to perform distributed training using PyTorch's DistributedDataParallel (DDP) on multiple GPUs, but I encounter a RuntimeError indicating that tensors a... | https://stackoverflow.com/questions/79856399/weird-pytorch-error-in-distributed-training-on-multiple-gpus-runtimeerror-exp | python, pytorch, multi-gpu | 1,766,954,263 |
se_65460699 | stackoverflow | MACHINE_LEARNING | Where does the downloaded models in JupyterNotebook locat at? | Where does the downloaded models in JupyterNotebook locat at?
When I run this command, I can see that I download the model. So, where are these kind of downloaded model/data/tokenizers stored in my machine ?
Thanks ! | https://stackoverflow.com/questions/65460699/where-does-the-downloaded-models-in-jupyternotebook-locat-at | python, pip, nlp, jupyter-notebook, pytorch | 1,609,016,661 |
se_78500154 | stackoverflow | MACHINE_LEARNING | torch.optim - AttributeError: partially initialized module 'torch' has no attribute '_jit_internal' (most likely due to a circular import) | torch.optim - AttributeError: partially initialized module 'torch' has no attribute '_jit_internal' (most likely due to a circular import)
Currently there is some issue about torch in my computer.
When I initiate the below code,
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
i... | https://stackoverflow.com/questions/78500154/torch-optim-attributeerror-partially-initialized-module-torch-has-no-attrib | python, pytorch, dependencies | 1,716,045,327 |
se_79846492 | stackoverflow | MACHINE_LEARNING | Pretrained resnet 18 model doesn't have fc layer and has cls and pool layers instead? "Missing key (s) in state_dict: "fc.weight", "fc.bias"." | Pretrained resnet 18 model doesn't have fc layer and has cls and pool layers instead? "Missing key (s) in state_dict: "fc.weight", "fc.bias"."
I am trying to implement this repo in a simple way in my own project. I learned what each layer should do. I thought getting a pretrained AI a... | https://stackoverflow.com/questions/79846492/pretrained-resnet-18-model-doesnt-have-fc-layer-and-has-cls-and-pool-layers-ins | machine-learning, pytorch, artificial-intelligence, resnet, pre-trained-model | 1,765,623,229 |
se_47544051 | stackoverflow | MACHINE_LEARNING | When should I use nn.ModuleList and when should I use nn.Sequential? | When should I use nn.ModuleList and when should I use nn.Sequential?
I am new to Pytorch and one thing that I don't quite understand is the usage of nn.ModuleList and nn.Sequential. Can I know when I should use one over the other? Thanks. | https://stackoverflow.com/questions/47544051/when-should-i-use-nn-modulelist-and-when-should-i-use-nn-sequential | pytorch | 1,511,922,277 |
se_73266516 | stackoverflow | MACHINE_LEARNING | Pytorch equivalent of `register_buffer` in flax/jax | Pytorch equivalent of `register_buffer` in flax/jax
I'm searching a way to write the equivalent of the following Pytorch module in Flax but I haven't found a way to do it. The important thing is that the constant should be loadable and saveable upon checkpoint.
class SillyModule(nn.Module):
def __init__(self, ):
... | https://stackoverflow.com/questions/73266516/pytorch-equivalent-of-register-buffer-in-flax-jax | python, deep-learning, pytorch, jax, flax | 1,659,866,291 |
se_67039914 | stackoverflow | MACHINE_LEARNING | How to clamp output of neuron in pytorch | How to clamp output of neuron in pytorch
I am using simple nn linear model(20,64,64,2) for deep reinforcement learning. This model I am using to approximate the policy gradients by the PPO algorithm. Hence the output layer gives 2 values, which are mean and standard deviation. These parameters are further used in the ... | https://stackoverflow.com/questions/67039914/how-to-clamp-output-of-neuron-in-pytorch | python, pytorch, reinforcement-learning, policy-gradient-descent | 1,618,094,484 |
se_79822232 | stackoverflow | MACHINE_LEARNING | Fixing a UNET in pytorch that doesn't work in eval mode due to BatchNorm2d layers | Fixing a UNET in pytorch that doesn't work in eval mode due to BatchNorm2d layers
I have a UNET model trained in pytorch (by someone else) that produces quite different results in eval mode to train mode (train mode results look good, eval mode they are rubbish). A bit of googling suggests this is a common problem... | https://stackoverflow.com/questions/79822232/fixing-a-unet-in-pytorch-that-doesnt-work-in-eval-mode-due-to-batchnorm2d-layer | pytorch, batch-normalization, batchnorm | 1,763,378,795 |
se_48001598 | stackoverflow | MACHINE_LEARNING | Why do we need to call zero_grad() in PyTorch? | Why do we need to call zero_grad() in PyTorch?
Why does zero_grad() need to be called during training?
| zero_grad(self)
| Sets gradients of all model parameters to zero. | https://stackoverflow.com/questions/48001598/why-do-we-need-to-call-zero-grad-in-pytorch | python, neural-network, deep-learning, pytorch, gradient-descent | 1,514,435,500 |
se_79124915 | stackoverflow | MACHINE_LEARNING | How to display meaningful names for intermediate operations in PyTorch computational graph visualization? | 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 shows generi... | https://stackoverflow.com/questions/79124915/how-to-display-meaningful-names-for-intermediate-operations-in-pytorch-computati | python-3.x, pytorch, torchvision | 1,729,845,706 |
se_79852884 | stackoverflow | MACHINE_LEARNING | How to dynamically estimate maximum number of cameras my GPU can handle for YOLOv8 inference? | How to dynamically estimate maximum number of cameras my GPU can handle for YOLOv8 inference?
I’m trying to simulate multiple camera streams feeding into a YOLOv8l model on a single GPU and monitor real-time hardware utilization. My setup:
Single GPU (48GB VRAM, CUDA-enabled)
YOLOv8l model
Simulating N cameras with... | https://stackoverflow.com/questions/79852884/how-to-dynamically-estimate-maximum-number-of-cameras-my-gpu-can-handle-for-yolo | python, tensorflow, deep-learning, pytorch, nvidia | 1,766,406,199 |
se_79757853 | stackoverflow | MACHINE_LEARNING | Manipulating a large dataframe most efficiently | Manipulating a large dataframe most efficiently
Imagine I have this dataframe called temp:
temp = pd.DataFrame(index = [x for x in range(0, 10)], columns = list('abcd'))
for row in temp.index:
temp.loc[row] = default_rng().choice(10, size=4, replace=False)
temp.loc[1, 'b'] = np.nan
temp.loc[3, 'd'] = np.nan
... | https://stackoverflow.com/questions/79757853/manipulating-a-large-dataframe-most-efficiently | python, pandas, dataframe, numpy, pytorch | 1,757,202,088 |
se_47488598 | stackoverflow | MACHINE_LEARNING | AttributeError: 'CrossEntropyLoss' object has no attribute 'backward' | AttributeError: 'CrossEntropyLoss' object has no attribute 'backward'
i am trying to train a very basic CNN on CIFAR10 data set and getting the following error :
AttributeError: 'CrossEntropyLoss' object has no attribute 'backward'
criterion =nn.CrossEntropyLoss
optimizer=optim.SGD(net.parameters(),lr... | https://stackoverflow.com/questions/47488598/attributeerror-crossentropyloss-object-has-no-attribute-backward | python, neural-network, deep-learning, conv-neural-network, pytorch | 1,511,630,107 |
se_78752245 | stackoverflow | MACHINE_LEARNING | How to install pytorch compatible with CUDA 11.7? | How to install pytorch compatible with CUDA 11.7?
I have "NVIDIA GeForce RTX 2070" GPU on my machine. I found CUDA 11.7 is the latest version of CUDA thats compatible with this GPU and works with pytorch. I have installed CUDA 11.7. Now I am trying to install pytorch that works with CUDA 11.7.
I tried this:
pip instal... | https://stackoverflow.com/questions/78752245/how-to-install-pytorch-compatible-with-cuda-11-7 | pytorch, pip, conda | 1,721,086,751 |
se_79831561 | stackoverflow | MACHINE_LEARNING | Having trouble with R's torch and tensor dimensions | Having trouble with R's torch and tensor dimensions
I am trying to follow along with this webpage: https://jtr13.github.io/cc21fall2/tutorial-on-r-torch-package.html
I am trying to understand R's implementation of PyTorch.
I am having some trouble with the tensor dimensions not matching up. R's Torch package is sa... | https://stackoverflow.com/questions/79831561/having-trouble-with-rs-torch-and-tensor-dimensions | r, pytorch, tensor, torch | 1,764,235,692 |
se_79670155 | stackoverflow | MACHINE_LEARNING | Executorch v. 0.6 -- Failed build of apple-ios example | Executorch v. 0.6 -- Failed build of apple-ios example
I have an issue when trying building the apple-ios example app using XCode. I am working on a MacBook Pro 2021 with M1 processor.
When opening the XCode project I have the following two issues in LLaMaRunner:
Undefined symbol: executorch::extension::llm::load_tok... | https://stackoverflow.com/questions/79670155/executorch-v-0-6-failed-build-of-apple-ios-example | python, pytorch | 1,750,229,831 |
se_67845882 | stackoverflow | MACHINE_LEARNING | "IndexError: Target 1 is out of bounds" from CrossEntropyLoss | "IndexError: Target 1 is out of bounds" from CrossEntropyLoss
When I run the program below, it gives me an error. The problem seems to be in the loss function but I can't find it. I have read the Pytorch Documentation for nn.CrossEntropyLoss but still can't find the problem.
Image size is (1 x 256 x 256),
Ba... | https://stackoverflow.com/questions/67845882/indexerror-target-1-is-out-of-bounds-from-crossentropyloss | python, pytorch | 1,622,862,147 |
se_59192705 | stackoverflow | MACHINE_LEARNING | How to apply bounds on a variable when performing optimisation in Pytorch? | How to apply bounds on a variable when performing optimisation in Pytorch?
I am trying to use Pytorch for non-convex optimisation, trying to maximise my objective (so minimise in SGD). I would like to bound my dependent variable x > 0, and also have the sum of my x values be less than 1000.
I think I have the penalty ... | https://stackoverflow.com/questions/59192705/how-to-apply-bounds-on-a-variable-when-performing-optimisation-in-pytorch | optimization, pytorch, clamp, non-convex | 1,575,540,515 |
se_68351091 | stackoverflow | MACHINE_LEARNING | RuntimeError: all elements of input should be between 0 and 1 | RuntimeError: all elements of input should be between 0 and 1
I want to use an RNN with bilstm layers using pytorch on protein embeddings. It worked with Linear Layer but when i use Bilstm i have a Runtime error. Sorry if its not clear its my first publication and i will be grateful if someone can help me.
from collec... | https://stackoverflow.com/questions/68351091/runtimeerror-all-elements-of-input-should-be-between-0-and-1 | pytorch, pytorch-lightning | 1,626,108,376 |
se_64334033 | stackoverflow | MACHINE_LEARNING | How to solve "RuntimeError: CUDA error: invalid device ordinal" | How to solve "RuntimeError: CUDA error: invalid device ordinal"
I'm trying to run this code. I don't know what is wrong with it, but this code is not running. and I don't know how to solve this problem.
import cv2
from facial_emotion_recognition import EmotionRecognition
emotion_detector = EmotionRecognitio... | https://stackoverflow.com/questions/64334033/how-to-solve-runtimeerror-cuda-error-invalid-device-ordinal | python, pytorch | 1,602,587,162 |
se_71393736 | stackoverflow | MACHINE_LEARNING | How to access latest torchvision.models (e.g. ViT) | How to access latest torchvision.models (e.g. ViT)
I have seen in the official torchvision docs that recently vision transformers and the ConvNeXt model families have been added to the PyTorch model zoo. However, even after upgrading to latest torchvision version 0.11.3 (via pip) these new models are not available:
>>... | https://stackoverflow.com/questions/71393736/how-to-access-latest-torchvision-models-e-g-vit | python, pytorch | 1,646,736,519 |
se_58419436 | stackoverflow | MACHINE_LEARNING | Extracting attention weights of each token at each layer of transformer in python | Extracting attention weights of each token at each layer of transformer in python
I am doing some NLP and I am interested in extracting attention weights of individual test token at each layer of transformer via Python (PyTorch, TensorFlow, etc.)
Is coding up a Transformer (any transformers like Transformer-XL, OpenA... | https://stackoverflow.com/questions/58419436/extracting-attention-weights-of-each-token-at-each-layer-of-transformer-in-pytho | tensorflow, keras, deep-learning, nlp, pytorch | 1,571,249,871 |
se_79843623 | stackoverflow | MACHINE_LEARNING | When using PyTorch torchrl TD0Estimator, how to handle the "done" and "terminated" flag | When using PyTorch torchrl TD0Estimator, how to handle the "done" and "terminated" flag
Based on the TD0Estimator documentation, it is using 2 Tensordict keys to flag whether episode has ended or not. But i can't seems to find any indication when and how to use it.
As an example, let's say on train... | https://stackoverflow.com/questions/79843623/when-using-pytorch-torchrl-td0estimator-how-to-handle-the-done-and-terminate | pytorch, reinforcement-learning, ddpg | 1,765,430,196 |
se_79840689 | stackoverflow | MACHINE_LEARNING | instance segmentation on custom coco dataset using pytorch maskrcnn + fpn for 83 categories (+background) | instance segmentation on custom coco dataset using pytorch maskrcnn + fpn for 83 categories (+background)
I am running a training of instance segmentation on custom coco dataset using pytorch maskrcnn + fpn for 83 categories (+background).
What is the problem with following setup and why RPN head not learning at all? ... | https://stackoverflow.com/questions/79840689/instance-segmentation-on-custom-coco-dataset-using-pytorch-maskrcnn-fpn-for-83 | machine-learning, pytorch, computer-vision, mask-rcnn, instance-segmentation | 1,765,179,045 |
se_50541851 | stackoverflow | MACHINE_LEARNING | Is there a function in google.colab module to close the runtime | Is there a function in google.colab module to close the runtime
Sometimes when I give run in google.colab I cant stay infront of the computer to manually disconnect from the server when the run is complete and the connection stays on even when my run is complete occupying the node for no reason.
Is there a function i... | https://stackoverflow.com/questions/50541851/is-there-a-function-in-google-colab-module-to-close-the-runtime | python, pytorch, google-colaboratory | 1,527,331,073 |
se_79373781 | stackoverflow | MACHINE_LEARNING | wsl2 crash with error [process exited with code 1] when installing pytorch 2.5.1 | wsl2 crash with error [process exited with code 1] when installing pytorch 2.5.1
I use the following command to install pytorch in the WSL2 environment,
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
and I keep getting the following error:
Installing collected packages: ... | https://stackoverflow.com/questions/79373781/wsl2-crash-with-error-process-exited-with-code-1-when-installing-pytorch-2-5-1 | pytorch, windows-subsystem-for-linux, wsl2 | 1,737,450,361 |
se_79840323 | stackoverflow | MACHINE_LEARNING | Installing Python with PyTorch - PowerShell not recognizing Torch package | Installing Python with PyTorch - PowerShell not recognizing Torch package
I have a problem where I am trying to use PyCharm for PyTorch. I have installed Python separately (quite a task as it tried to install it in the Microsoft/AppData folder?).
In PyCharm, I have to first manually set the Python.exe location, which ... | https://stackoverflow.com/questions/79840323/installing-python-with-pytorch-powershell-not-recognizing-torch-package | python, pytorch | 1,765,122,227 |
se_79428459 | stackoverflow | MACHINE_LEARNING | torch-sparse install, module 'torch' not found even with torch installed | torch-sparse install, module 'torch' not found even with torch installed
I am trying to install the dependencies for this repository https://github.com/kvignesh1420/gnn_collapse which specifies package versions that are a few years old. I have installed Python 3.9, created a virtual environment from that insta... | https://stackoverflow.com/questions/79428459/torch-sparse-install-module-torch-not-found-even-with-torch-installed | pytorch, pip | 1,739,226,342 |
se_74204664 | stackoverflow | MACHINE_LEARNING | Pytorch - Selecting n indices without replacement from dimension x | Pytorch - Selecting n indices without replacement from dimension x
Suppose I have the following embeddings emb_user = torch.randn(64, 128, 256). From the second dimension (of length 128), I wish to pick out 16 at random at each instance. I was wondering if there was a more efficient way of doing the following:
idx = t... | https://stackoverflow.com/questions/74204664/pytorch-selecting-n-indices-without-replacement-from-dimension-x | pytorch | 1,666,772,490 |
se_69956001 | stackoverflow | MACHINE_LEARNING | what does mask_fill in pytorch do here | what does mask_fill in pytorch do here
I have tensor named "k1" which is in shape 3,1,1,9 and also have p1 tensor in shape of 3,7,9,9 and I wanna know what does the line below do?
p1 = p1 .masked_fill(k1== 0, float("-1e30")) | https://stackoverflow.com/questions/69956001/what-does-mask-fill-in-pytorch-do-here | python, pytorch | 1,636,819,695 |
se_74092624 | stackoverflow | MACHINE_LEARNING | Does Automatic MIXED PRECISION (AMP) half the paramters of a model? | Does Automatic MIXED PRECISION (AMP) half the paramters of a model?
Before I knew about automatic mixed precision, I manually halved the model and data using half() for training with half precision. But the training result is not good at all.
Then I used the automatic mixed precision to train a network, which returns ... | https://stackoverflow.com/questions/74092624/does-automatic-mixed-precision-amp-half-the-paramters-of-a-model | pytorch, automatic-mixed-precision | 1,665,981,328 |
se_54843067 | stackoverflow | MACHINE_LEARNING | No module named "Torch" | No module named "Torch"
I successfully installed pytorch via conda:
conda install pytorch-cpu torchvision-cpu -c pytorch
I also successfully installed pytorch via pip:
pip3 install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp36-cp36m-win_amd64.whl
pip3 install torchvision
But, it only works in a jup... | https://stackoverflow.com/questions/54843067/no-module-named-torch | python, pip, pytorch, conda | 1,550,935,291 |
se_79541677 | stackoverflow | MACHINE_LEARNING | How to enable MPS acceleration for PyTorch inside Docker on Mac? | How to enable MPS acceleration for PyTorch inside Docker on Mac?
I'm trying to set up Docker for a Python project on my Mac and want to use MPS (Metal Performance Shaders) for GPU acceleration with PyTorch inside the container.
What I have tried so far:
I installed Docker Desktop (the latest version of Apple Silicon)... | https://stackoverflow.com/questions/79541677/how-to-enable-mps-acceleration-for-pytorch-inside-docker-on-mac | python, docker, macos, pytorch, metal-performance-shaders | 1,743,171,683 |
se_73293878 | stackoverflow | MACHINE_LEARNING | Add new elements to Pytorch tensor | Add new elements to Pytorch tensor
I have a tensor that looks like this:
I would like to add 0 to each inner tensor. So we have something like[0.1111, 0.6667, 0].
Any suggestion would be appreciated. | https://stackoverflow.com/questions/73293878/add-new-elements-to-pytorch-tensor | pytorch, tensor | 1,660,056,698 |
se_77094995 | stackoverflow | MACHINE_LEARNING | How to choose num_workers for jetson-inference train.py on Jetson AGX Orin? | How to choose num_workers for jetson-inference train.py on Jetson AGX Orin?
I recently started working with the Jetson AGX Orin 64GB. Im currently working through the Hello AI World and the Transfer Learning Sections of dusty's jetson-inference github dusty's jetson-inference github and need help understanding/setting... | https://stackoverflow.com/questions/77094995/how-to-choose-num-workers-for-jetson-inference-train-py-on-jetson-agx-orin | pytorch, pytorch-dataloader, nvidia-jetson | 1,694,590,738 |
se_72022436 | stackoverflow | MACHINE_LEARNING | vectorize pytorch tensor indexing | vectorize pytorch tensor indexing
I have a batch of images img_batch, size [8,3,32,32], and I want to manipulate each image by setting randomly selected pixels to zero. I can do this using a for loop over each image but I'm not sure how to vectorize it so I'm not processing only one image at a time. This is my code u... | https://stackoverflow.com/questions/72022436/vectorize-pytorch-tensor-indexing | indexing, pytorch, vectorization, tensor | 1,651,024,633 |
se_79772918 | stackoverflow | MACHINE_LEARNING | Encountering an AttibuteError: module 'torch' has no attribute 'xpu' | Encountering an AttibuteError: module 'torch' has no attribute 'xpu'
I'm encountering an error
AttibuteError: module 'torch' has no attribute 'xpu'
when running the diffusers library in a Google Colab environment with a CUDA GPU. I'm trying to use DiffusionPipleline.from_pretrained with stabilityai/s... | https://stackoverflow.com/questions/79772918/encountering-an-attibuteerror-module-torch-has-no-attribute-xpu | pytorch, gpu, google-colaboratory, diffusers | 1,758,649,262 |
se_59129812 | stackoverflow | MACHINE_LEARNING | How to avoid "CUDA out of memory" in PyTorch | How to avoid "CUDA out of memory" in PyTorch
I think it's a pretty common message for PyTorch users with low GPU memory:
RuntimeError: CUDA out of memory. Tried to allocate X MiB (GPU X; X GiB total capacity; X GiB already allocated; X MiB free; X cached)
I tried to process an image by loading each layer to... | https://stackoverflow.com/questions/59129812/how-to-avoid-cuda-out-of-memory-in-pytorch | python, deep-learning, pytorch, object-detection, low-memory | 1,575,233,173 |
se_79735857 | stackoverflow | MACHINE_LEARNING | KeyError when loading GPT-OSS-20B locally with transformers on CPU | KeyError when loading GPT-OSS-20B locally with transformers on CPU
I’m trying to load gpt-oss-20b locally using Hugging Face transformers with CPU only. Minimal code:
from transformers import pipeline
model_path = "/mnt/d/Projects/models/gpt-oss-20b"
pipe = pipeline("text-generation", model=model_path, torch_dtype="au... | https://stackoverflow.com/questions/79735857/keyerror-when-loading-gpt-oss-20b-locally-with-transformers-on-cpu | python, pytorch, huggingface-transformers, huggingface, google-publisher-tag | 1,755,201,610 |
se_79835734 | stackoverflow | MACHINE_LEARNING | Performance problem with automatic parallelization in `pytorch` | Performance problem with automatic parallelization in `pytorch`
I'm having problems with python code that uses pytorch. The details are a bit complicated (the code is part of a quantum mechanical calculation) but the code structure is very straightforward and looks more or less like this:
# p is a batch containing 100... | https://stackoverflow.com/questions/79835734/performance-problem-with-automatic-parallelization-in-pytorch | python, multithreading, pytorch | 1,764,671,089 |
se_79833972 | stackoverflow | MACHINE_LEARNING | PyTorch not recognizing RTX 5090 (sm_120) on Windows 11 – CUDA error: no kernel image available | PyTorch not recognizing RTX 5090 (sm_120) on Windows 11 – CUDA error: no kernel image available
I'm trying to use PyTorch with an NVIDIA GeForce RTX 5090 (Blackwell architecture, CUDA Compute Capability sm_120) on Windows 11, and I keep running into compatibility issues. PyTorch detects CUDA, but any GPU operation fai... | https://stackoverflow.com/questions/79833972/pytorch-not-recognizing-rtx-5090-sm-120-on-windows-11-cuda-error-no-kernel | python, pytorch, gpu, large-language-model | 1,764,513,813 |
se_79832239 | stackoverflow | MACHINE_LEARNING | Attribution Error when using Huggingface transformers Trainer with FSDP | Attribution Error when using Huggingface transformers Trainer with FSDP
I am now trying to use FSDP in Huggingface transformers Trainer. The training script is something like
train_dataset = Mydataset(...)
args = TrainingArguments(...)
model = LlamaForCausalLM.from_pretrained(model_path, attn_implementation="flex_at... | https://stackoverflow.com/questions/79832239/attribution-error-when-using-huggingface-transformers-trainer-with-fsdp | pytorch, parallel-processing, huggingface-transformers, accelerate | 1,764,303,112 |
se_79833642 | stackoverflow | MACHINE_LEARNING | How do I visualize the latent representation produced by the Stable Diffusion VAE? | How do I visualize the latent representation produced by the Stable Diffusion VAE?
I am trying to visualize the latent representation produced by the VAE inside a Stable Diffusion pipeline
from diffusers import StableDiffusionPipeline
import torch
# A CUDA ordinal is simply the integer ID of a GPU in a system that ha... | https://stackoverflow.com/questions/79833642/how-do-i-visualize-the-latent-representation-produced-by-the-stable-diffusion-va | python, pytorch, torchvision, stable-diffusion, diffusers | 1,764,470,190 |
se_79825981 | stackoverflow | MACHINE_LEARNING | PyTorch .view() operation to manipulate tensor dimensions vis a vis using torch.unbind followed by torch.cat | PyTorch .view() operation to manipulate tensor dimensions vis a vis using torch.unbind followed by torch.cat
In Torch, .view() reshapes the tensor. However, there are multiple ways to reshape a multi-dimensional tensor to a target shape. How does it decide between those different ways?
For example, in Torch, suppose w... | https://stackoverflow.com/questions/79825981/pytorch-view-operation-to-manipulate-tensor-dimensions-vis-a-vis-using-torch | pytorch, tensor, torch | 1,763,675,269 |
se_79829361 | stackoverflow | MACHINE_LEARNING | When using TensorDictPrioritizedReplayBuffer, should I apply the priority weight manually or not? | When using TensorDictPrioritizedReplayBuffer, should I apply the priority weight manually or not?
With Prioritized Experience Replay (PER), we use Beta parameter, so we can find weight that will be used to offset the bias introduced by PER. Now, with PyTorch's TensorDictPrioritizedReplayBuffer, I think it is stored in... | https://stackoverflow.com/questions/79829361/when-using-tensordictprioritizedreplaybuffer-should-i-apply-the-priority-weight | pytorch, reinforcement-learning, loss-function | 1,764,052,982 |
se_76376486 | stackoverflow | MACHINE_LEARNING | How to install Pytorch with CUDA support using conda? | How to install Pytorch with CUDA support using conda?
I downloaded cuda and pytorch using conda:
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
conda list
python 3.11.0 h7a1cb2a_2 anaconda
pytorch 2.0.1 py3.11_cpu_... | https://stackoverflow.com/questions/76376486/how-to-install-pytorch-with-cuda-support-using-conda | pytorch, conda | 1,685,559,032 |
se_79832696 | stackoverflow | MACHINE_LEARNING | AWS SageMaker PyTorch Model Deployment - is entry_point needed? | AWS SageMaker PyTorch Model Deployment - is entry_point needed?
I'm trying to deploy a pre-trained PyTorch model to SageMaker using the Python SDK. I have a model.tar.gz file that is uploaded to S3, with the following structure:
code/
code/requirements.txt
code/inference.py
code/utils.py
model.pt
I also have the foll... | https://stackoverflow.com/questions/79832696/aws-sagemaker-pytorch-model-deployment-is-entry-point-needed | amazon-web-services, pytorch, amazon-sagemaker | 1,764,342,878 |
se_79832672 | stackoverflow | MACHINE_LEARNING | Good packages for bounded Linear Quantile Regression? | Good packages for bounded Linear Quantile Regression?
I'm looking for a good package to train a linear quantile regression model, i.e. $\hat y = \sum_{i=1}^n w_i \cdot X_i$. With $x_i$ are the input features, and $w_i$ are the bounded trainable weights. This should all be trained with quantile loss.
Here's the catch: ... | https://stackoverflow.com/questions/79832672/good-packages-for-bounded-linear-quantile-regression | python, scikit-learn, pytorch, linear-programming, quantile-regression | 1,764,341,400 |
se_48324152 | stackoverflow | MACHINE_LEARNING | How to change the learning rate of an optimizer at any given moment (no LR schedule)? | How to change the learning rate of an optimizer at any given moment (no LR schedule)?
Is it possible in PyTorch to change the learning rate of the optimizer in the middle of training dynamically (I don't want to define a learning rate schedule beforehand)?
So let's say I have an optimizer:
optim = torch.optim.SGD(mo... | https://stackoverflow.com/questions/48324152/how-to-change-the-learning-rate-of-an-optimizer-at-any-given-moment-no-lr-sched | python, optimization, neural-network, deep-learning, pytorch | 1,516,287,352 |
se_79826375 | stackoverflow | MACHINE_LEARNING | pytorch Module B=A, A.to('cpu'), but the tensor in B is still in GPU, why? | pytorch Module B=A, A.to('cpu'), but the tensor in B is still in GPU, why?
After converting module A to CPU, the origin parameter tensor still stays on the GPU? When it is released? Is it wrong if I reuse the parameter?
My code:
import torch.nn as nn
class A(nn.Module):
def __init__(self):
super()... | https://stackoverflow.com/questions/79826375/pytorch-module-b-a-a-tocpu-but-the-tensor-in-b-is-still-in-gpu-why | python, pytorch, module, tensor | 1,763,719,882 |
se_66284850 | stackoverflow | MACHINE_LEARNING | Pytorch transforms.Compose usage for pair of images in segmentation tasks | Pytorch transforms.Compose usage for pair of images in segmentation tasks
I'm trying to use the transforms.Compose() in my segmentation task. But I'm not sure how to use the same (almost) random transforms for both the image and the mask.
So in my segmentation task, I have the raw picture and the corresponding mask, I... | https://stackoverflow.com/questions/66284850/pytorch-transforms-compose-usage-for-pair-of-images-in-segmentation-tasks | python, image, machine-learning, pytorch | 1,613,767,950 |
se_79597367 | stackoverflow | MACHINE_LEARNING | PyTorch on M4 Mac on MPS run dramatically slower compared to CPU | PyTorch on M4 Mac on MPS run dramatically slower compared to CPU
I'm using a M4 MacBook Pro and I'm trying to run a simple NN on MNIST data. The performance on mps is supposed to be better than that of cpu. But it is dramatically slower. Even for a simple NN like the one below, on CPU it takes around 1s, but on mps it... | https://stackoverflow.com/questions/79597367/pytorch-on-m4-mac-on-mps-run-dramatically-slower-compared-to-cpu | python, pytorch | 1,745,879,922 |
se_79295498 | stackoverflow | MACHINE_LEARNING | UserWarning: Mutation on a buffer in the model is detected. ExecuTorch assumes buffers that are mutated in the graph have a meaningless initial state | UserWarning: Mutation on a buffer in the model is detected. ExecuTorch assumes buffers that are mutated in the graph have a meaningless initial state
I have exported model to Executorch program, and the file is saved correctly in directory. But I enountered warning like this
# To see more debug info, please use `graph... | https://stackoverflow.com/questions/79295498/userwarning-mutation-on-a-buffer-in-the-model-is-detected-executorch-assumes-b | python, deep-learning, pytorch, conv-neural-network | 1,734,639,166 |
se_79823875 | stackoverflow | MACHINE_LEARNING | .so file built on same CPU but different EC2 instances lead to missing symbols | .so file built on same CPU but different EC2 instances lead to missing symbols
I am building a wheel of PyTorch from source, based on their https://github.com/pytorch/pytorch/blob/v2.6.0/.ci/manywheel/build_common.sh CI build script. I tested on a "local" instance of a g5.xlarge EC2 instance, I installed it with pip a... | https://stackoverflow.com/questions/79823875/so-file-built-on-same-cpu-but-different-ec2-instances-lead-to-missing-symbols | pytorch, linker, shared-libraries | 1,763,502,046 |
se_78376085 | stackoverflow | MACHINE_LEARNING | RuntimeError: Default process group has not been initialized, please make sure to call init_process_group | RuntimeError: Default process group has not been initialized, please make sure to call init_process_group
I am using CoDi which is multimodal Latent diffusion model. I am trying to remove the modules on images and video from CoDi and fine tune it with text-music pair data.
The training script (train.py) for generating... | https://stackoverflow.com/questions/78376085/runtimeerror-default-process-group-has-not-been-initialized-please-make-sure-t | python, machine-learning, deep-learning, pytorch, artificial-intelligence | 1,713,935,111 |
se_79814751 | stackoverflow | MACHINE_LEARNING | How to configure uv via pyproject.toml to lock PyTorch (+cu118) to a custom index and prevent uv run from using the CPU-only version? | How to configure uv via pyproject.toml to lock PyTorch (+cu118) to a custom index and prevent uv run from using the CPU-only version?
I am managing a project with uv (v0.9.4) that requires a specific PyTorch CUDA build. The generic installation works, but using uv run causes a package conflict, despite the environment... | https://stackoverflow.com/questions/79814751/how-to-configure-uv-via-pyproject-toml-to-lock-pytorch-cu118-to-a-custom-inde | python, pip, pytorch, uv | 1,762,687,378 |
se_79815748 | stackoverflow | MACHINE_LEARNING | Is passing ray resources as options when calling the function equivalent to setting them in the function's decorator? | Is passing ray resources as options when calling the function equivalent to setting them in the function's decorator?
Is
@ray.remote
def run_experiment(...):
(...)
if __name__ == '__main__':
ray.init()
exp_config = sys.argv[1]
params_tuples, num_cpus, num_gpus = load_exp_config(exp_config)
ray.... | https://stackoverflow.com/questions/79815748/is-passing-ray-resources-as-options-when-calling-the-function-equivalent-to-sett | python, pytorch, gpu, slurm, ray | 1,762,786,265 |
se_79418845 | stackoverflow | MACHINE_LEARNING | What to do when the gradient explodes in a Transformer model? | What to do when the gradient explodes in a Transformer model?
General question (hopefully useful for people coming from google): What to do when the gradient explodes? When working with transformers and deep NNs (with PyTorch), do you have a mental checklist of things to investigate and try when your gradient explodes... | https://stackoverflow.com/questions/79418845/what-to-do-when-the-gradient-explodes-in-a-transformer-model | pytorch, transformer-model | 1,738,863,101 |
se_79822226 | stackoverflow | MACHINE_LEARNING | Given groups=1, weight of size [64, 1024, 1, 1], expected input[1, 256, 1, 1] to have 1024 channels, but got 256 channels instead | Given groups=1, weight of size [64, 1024, 1, 1], expected input[1, 256, 1, 1] to have 1024 channels, but got 256 channels instead
I have encountered this issue and I searched on the forums but I couldnt solve it. How can I solve this problem ?
I tried to add CBAM module in yolov12 for my custom dataset to improve accu... | https://stackoverflow.com/questions/79822226/given-groups-1-weight-of-size-64-1024-1-1-expected-input1-256-1-1-to | python, pytorch | 1,763,378,577 |
se_79820875 | stackoverflow | MACHINE_LEARNING | My SimSiam is collapsing- SimSiam on CUB-200-2011 with ViT | My SimSiam is collapsing- SimSiam on CUB-200-2011 with ViT
I'm trying to implement SimSiam using a ViT backbone on the CUB-200-2011 dataset. However, during training, the embeddings collapse to a single direction despite using stop-gradient. Here’s what I observe in the first few epochs:
[Epoch 0] Loss = -0.12 | Col... | https://stackoverflow.com/questions/79820875/my-simsiam-is-collapsing-simsiam-on-cub-200-2011-with-vit | pytorch, vision-transformer, self-supervised-learning | 1,763,214,495 |
se_58216000 | stackoverflow | MACHINE_LEARNING | Get total amount of free GPU memory and available using pytorch | Get total amount of free GPU memory and available using pytorch
I'm using google colab free Gpu's for experimentation and wanted to know how much GPU Memory available to play around, torch.cuda.memory_allocated() returns the current GPU memory occupied, but how do we determine total available memory using PyTorch. | https://stackoverflow.com/questions/58216000/get-total-amount-of-free-gpu-memory-and-available-using-pytorch | python, pytorch, gpu, google-colaboratory | 1,570,094,302 |
se_77700170 | stackoverflow | MACHINE_LEARNING | PyTorch Lightning DDP Error with SLURM: GPU MisconfigurationException and Devices Mismatch | PyTorch Lightning DDP Error with SLURM: GPU MisconfigurationException and Devices Mismatch
I'm running a PyTorch Lightning training script on a SLURM-managed cluster using Distributed Data Parallel (DDP). My setup involves 1 node with 4 GPUs. However, I'm encountering issues with the configuration of GPUs in my traini... | https://stackoverflow.com/questions/77700170/pytorch-lightning-ddp-error-with-slurm-gpu-misconfigurationexception-and-device | pytorch, gpu, slurm, pytorch-lightning | 1,703,187,347 |
se_72474360 | stackoverflow | MACHINE_LEARNING | My RNN with attention model always predict the same class even if my data is not imbalanced | My RNN with attention model always predict the same class even if my data is not imbalanced
This is my attention layer code:
Implementation of attention layer
class Attention(nn.Module):
def __init__(self, feature_dim, step_dim, bias=True, **kwargs):
super(Attention, self).__init__(**kwargs)
... | https://stackoverflow.com/questions/72474360/my-rnn-with-attention-model-always-predict-the-same-class-even-if-my-data-is-not | python, pytorch, lstm, recurrent-neural-network, attention-model | 1,654,164,153 |
se_79810104 | stackoverflow | MACHINE_LEARNING | Unable to step into torch.nn.functional.linear using VS Code debugging | Unable to step into torch.nn.functional.linear using VS Code debugging
I want to step into the linear function using VS Code's step-in , but it skips automatically when I click "step into". Could anyone help me with this?
I used DEBUG=1 when compiling PyTorch.
I can't step into the linear function using either python ... | https://stackoverflow.com/questions/79810104/unable-to-step-into-torch-nn-functional-linear-using-vs-code-debugging | visual-studio-code, pytorch, gdb | 1,762,348,845 |
se_79815197 | stackoverflow | MACHINE_LEARNING | Where is EXECUTORCH_LIBRARY defined in ExecuTorch v1.0? | Where is EXECUTORCH_LIBRARY defined in ExecuTorch v1.0?
I’m trying to register a custom operator for ExecuTorch (v1.0, built from the PyTorch 2.5 source tree).
My goal is to create a shared library that defines a few quantum operators and runs them from a .pte model using the ExecuTorch runtime.
#include <torch/extens... | https://stackoverflow.com/questions/79815197/where-is-executorch-library-defined-in-executorch-v1-0 | machine-learning, mobile, pytorch | 1,762,750,310 |
se_68629652 | stackoverflow | MACHINE_LEARNING | How can I plot pytorch tensor? | How can I plot pytorch tensor?
I would like to plot pytorch gpu tensor:
input= torch.randn(100).to(device)
output = torch.where(input>=0, input, -input)
input = input.('cpu').detach().numpy().copy()
output = output.('cpu').detach().numpy().copy()
plt.plot(input,out)
However I try to convert those tensors into cpu, ... | https://stackoverflow.com/questions/68629652/how-can-i-plot-pytorch-tensor | python, pytorch, tensor | 1,627,957,314 |
se_79815652 | stackoverflow | MACHINE_LEARNING | Unclear formulation in Temporal Fusion Transformer paper | Unclear formulation in Temporal Fusion Transformer paper
I am currently trying to implement the Temporal Fusion Transformer using PyTorch.
This paper (https://arxiv.org/pdf/1912.09363) is my reference.
Currently I am stuck with the variable selection network (sec. 4.2). It was earlier established that a GRN (described... | https://stackoverflow.com/questions/79815652/unclear-formulation-in-temporal-fusion-transformer-paper | pytorch, forecasting | 1,762,781,590 |
se_74424579 | stackoverflow | MACHINE_LEARNING | CUDA is installed, but PyTorch v1.13 on Windows 10 not working. PyTorch not using GPU; how to fix PyTorch out of sync with CUDA 11.x drivers? | CUDA is installed, but PyTorch v1.13 on Windows 10 not working. PyTorch not using GPU; how to fix PyTorch out of sync with CUDA 11.x drivers?
How can I find where CUDA 11.x for PyTorch-GPU 1.13 get installed on Windows 10 on my computer?
What I tried:
I installed the NVIDIA CUDA drivers and toolkit for Windows from th... | https://stackoverflow.com/questions/74424579/cuda-is-installed-but-pytorch-v1-13-on-windows-10-not-working-pytorch-not-usin | windows, pytorch, cuda | 1,668,371,871 |
se_79785472 | stackoverflow | MACHINE_LEARNING | Installation error while installing GroundingDino | Installation error while installing GroundingDino
I am trying to install the GroundingDino as instructed in the README file of their official GitHub repo, but I am facing the error below:
Obtaining file:///home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/models/GroundingDINO
Preparing metadata (setup.py) ..... | https://stackoverflow.com/questions/79785472/installation-error-while-installing-groundingdino | machine-learning, pytorch, neural-network, large-language-model | 1,759,928,025 |
se_59648275 | stackoverflow | MACHINE_LEARNING | What to define as entrypoint when initializing a pytorch estimator with a custom docker image for training on AWS Sagemaker? | What to define as entrypoint when initializing a pytorch estimator with a custom docker image for training on AWS Sagemaker?
So I created a docker image for training. In the dockerfile I have an entrypoint defined such that when docker run is executed, it will start running my Python code.
To use this on aws sagemaker... | https://stackoverflow.com/questions/59648275/what-to-define-as-entrypoint-when-initializing-a-pytorch-estimator-with-a-custom | amazon-web-services, docker, pytorch, amazon-sagemaker, entry-point | 1,578,494,679 |
se_79812040 | stackoverflow | MACHINE_LEARNING | IndexError: index -1 is out of bounds for dimension 0 with size 0 | IndexError: index -1 is out of bounds for dimension 0 with size 0
I am currently experimenting with modifying the KV cache of the LLaVA model in order to perform controlled interventions during generation (similar to cache-steering methods in recent research). The goal is to alter the cached key-value tensors after th... | https://stackoverflow.com/questions/79812040/indexerror-index-1-is-out-of-bounds-for-dimension-0-with-size-0 | python, pytorch, huggingface-transformers | 1,762,501,264 |
se_79810670 | stackoverflow | MACHINE_LEARNING | How can I get torch.set_grad_enabled(True) to work in ComfyUI? | How can I get torch.set_grad_enabled(True) to work in ComfyUI?
I just spent hours figuring out that the following code fails when included in a ComfyUI custom node, but works perfectly fine outside (using the same Python venv). I finally found out that someone had called torch.set_grad_enabled(False) (I don't know why... | https://stackoverflow.com/questions/79810670/how-can-i-get-torch-set-grad-enabledtrue-to-work-in-comfyui | machine-learning, pytorch | 1,762,382,337 |
se_79803908 | stackoverflow | MACHINE_LEARNING | Decoder only model AI making repetitive responses | Decoder only model AI making repetitive responses
I am making a Decoder only transformer using Pytorch and my dataset of choice is the fullEnglish dataset from kaggle Plaintext Wikipedia (full English).
The problem is that my model output is repetitive:
print(generate(model=model, prompt="what is anarchism", tokenizer... | https://stackoverflow.com/questions/79803908/decoder-only-model-ai-making-repetitive-responses | python, deep-learning, pytorch | 1,761,748,358 |
se_79808718 | stackoverflow | MACHINE_LEARNING | Transformers 'could not import module pipeline' to jupyter notebook | Transformers 'could not import module pipeline' to jupyter notebook
I need to to run a series of pre-trained fine-tuned models from Hugging Face to Jupyter notebook. I have updated to the latest version of both PyTorch and Transformers, but when I run the code
from transformers import pipeline
pipe = pipeline(... | https://stackoverflow.com/questions/79808718/transformers-could-not-import-module-pipeline-to-jupyter-notebook | python, jupyter-notebook, pytorch, huggingface-transformers, huggingface | 1,762,247,786 |
se_79156403 | stackoverflow | MACHINE_LEARNING | DQN model either doesn't work or it is extremely slow in training | DQN model either doesn't work or it is extremely slow in training
I'm trying to build a DQN model for my PhD progress, and before I implement it with the actual real data, I want to utilize dummy data.
Using the same process with simple Q Learning the approach was effective, but once I transitioned it to DQN to ma... | https://stackoverflow.com/questions/79156403/dqn-model-either-doesnt-work-or-it-is-extremely-slow-in-training | python, pytorch, reinforcement-learning, dqn | 1,730,740,706 |
se_79806146 | stackoverflow | MACHINE_LEARNING | How should I balance DSA, ML fundamentals, PyTorch implementation, and Kaggle practice for ML Engineer interviews? | How should I balance DSA, ML fundamentals, PyTorch implementation, and Kaggle practice for ML Engineer interviews?
I’m a Computer Science graduate preparing for ML/AI Engineer roles.
I’m facing a dilemma about what to focus on, how much to allocate time to each area, and what exact roadmap to follow to prepare effecti... | https://stackoverflow.com/questions/79806146/how-should-i-balance-dsa-ml-fundamentals-pytorch-implementation-and-kaggle-pr | machine-learning, pytorch, data-science, kaggle, advice | 1,761,939,345 |
se_75421383 | stackoverflow | MACHINE_LEARNING | Resume Optuna study from most recent checkpoints | Resume Optuna study from most recent checkpoints
Is there a way to be able to pause/kill the optuna study, then resume it either by running the incomplete trials from the beginning, or resuming the incomplete trials from the latest checkpoint?
study = optuna.create_study()
study.optimize(objective) | https://stackoverflow.com/questions/75421383/resume-optuna-study-from-most-recent-checkpoints | python, pytorch, hyperparameters, optuna | 1,676,130,878 |
se_61488902 | stackoverflow | MACHINE_LEARNING | Cannot import Pytorch [WinError 126] The specified module could not be found | Cannot import Pytorch [WinError 126] The specified module could not be found
I'm trying to do a basic install and import of Pytorch/Torchvision on Windows 10. I installed a Anaconda and created a new virtual environment named photo. I opened Anaconda prompt, activated the environment, and I ran:
(photo) C:\Users\<use... | https://stackoverflow.com/questions/61488902/cannot-import-pytorch-winerror-126-the-specified-module-could-not-be-found | python, windows, pytorch, environment | 1,588,103,841 |
se_79805585 | stackoverflow | MACHINE_LEARNING | I get the error " ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory " when i try to use torch in virtual env | I get the error " ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory " when i try to use torch in virtual env
I have installed Cuda 13 on fedora 42 .
When i use pytorch localy, torch works fine, but when i creat a virtualenv my pytorch cant find the ibcudnn files.
I get the... | https://stackoverflow.com/questions/79805585/i-get-the-error-importerror-libcudnn-so-9-cannot-open-shared-object-file-no | python, pytorch | 1,761,902,504 |
se_79803321 | stackoverflow | MACHINE_LEARNING | Generating response with KV Cached System Prompt throws error when Input Tokens are less than Prompt Tokens | Generating response with KV Cached System Prompt throws error when Input Tokens are less than Prompt Tokens
I am trying to run Mistral-7B-Instruct-v0.2.
Each run is PROMPT + details[i].
PROMPT has instructions on how to generate JSON based on details.
As the prefix part of each input is same; kind of like a system pro... | https://stackoverflow.com/questions/79803321/generating-response-with-kv-cached-system-prompt-throws-error-when-input-tokens | pytorch, huggingface-transformers, mistral-7b | 1,761,692,096 |
se_74657919 | stackoverflow | MACHINE_LEARNING | groupby aggregate product in PyTorch | groupby aggregate product in PyTorch
I have the same problem as groupby aggregate mean in pytorch. However, I want to create the product of my tensors inside each group (or labels). Unfortunately, I couldn't find a native PyTorch function that could solve my problem, like a hypothetical scatter_prod_ for products (equ... | https://stackoverflow.com/questions/74657919/groupby-aggregate-product-in-pytorch | python, pytorch, tensor | 1,669,994,203 |
se_79801643 | stackoverflow | MACHINE_LEARNING | AttributeError: 'NoneType' object has no attribute 'blocks' when running Cache-DiT example with Wan2.2 model | AttributeError: 'NoneType' object has no attribute 'blocks' when running Cache-DiT example with Wan2.2 model
I’m trying to use
Cache-DiT
to accelerate inference for the Wan2.2 model.
However, when I run the example script,
python run_wan_2.2_i2v.py --steps 28 --cache
I get the following error.
Namespa... | https://stackoverflow.com/questions/79801643/attributeerror-nonetype-object-has-no-attribute-blocks-when-running-cache-d | deep-learning, pytorch, artificial-intelligence | 1,761,556,882 |
se_79799984 | stackoverflow | MACHINE_LEARNING | Having problems computing PDE Residuals | Having problems computing PDE Residuals
I'm computing PDE residuals for The_Well datasets (e.g. turbulent_radiative_layer_2D and shear_flow) using finite differences, but the residuals are much larger than I expect. The data are generated by simulations, so I expected residuals close to zero.
I compute derivatives wi... | https://stackoverflow.com/questions/79799984/having-problems-computing-pde-residuals | python, math, pytorch, pde, finite-difference | 1,761,474,164 |
se_79799014 | stackoverflow | MACHINE_LEARNING | Can I avoid setting-up and tearing down processes when using PyTorch DataLoader? | Can I avoid setting-up and tearing down processes when using PyTorch DataLoader?
In my scenario I use multiple DataLoaders with multiple Datasets to evaluate models against each other (I want to test models with multiple resolutions, which means each dataset has a distinct transform). I have a 2-GPU, 12-CPU Windows sy... | https://stackoverflow.com/questions/79799014/can-i-avoid-setting-up-and-tearing-down-processes-when-using-pytorch-dataloader | pytorch, multiprocessing | 1,761,325,821 |
se_79798080 | stackoverflow | MACHINE_LEARNING | Can uv integrate with e.g. pytorch prebuilt docker env? | Can uv integrate with e.g. pytorch prebuilt docker env?
So, pytorch requires a rather large bundle of packages. The prebuilt docker pytorch gpu images (https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/running.html) are quite helpful in this regard.
On the other hand, uv and its lockfile are also a... | https://stackoverflow.com/questions/79798080/can-uv-integrate-with-e-g-pytorch-prebuilt-docker-env | python, docker, pytorch, uv | 1,761,243,529 |
se_79797662 | stackoverflow | MACHINE_LEARNING | ModuleNotFoundError: No module named 'losses.loss'; 'losses' is not a package error when training MAT model (PyTorch, NVIDIA repo) | ModuleNotFoundError: No module named 'losses.loss'; 'losses' is not a package error when training MAT model (PyTorch, NVIDIA repo)
I'm trying to fine-tune the MAT (Masked Attention Transformer) model from the official repository:
https://github.com/fenglinglwb/MAT
However, I keep getting the following ... | https://stackoverflow.com/questions/79797662/modulenotfounderror-no-module-named-losses-loss-losses-is-not-a-package-er | python, pytorch | 1,761,214,603 |
se_79658224 | stackoverflow | MACHINE_LEARNING | evaluation_strategy() not supported in transformers library | evaluation_strategy() not supported in transformers library
I've recently been attempting to fine-tune the pretrained neural network, "cardiffnlp/twitter-roberta-base-offensive." However, when I attempted to run a Python program I created, "evaluation_strategy" was considered to be an "unexpected argument" regardless ... | https://stackoverflow.com/questions/79658224/evaluation-strategy-not-supported-in-transformers-library | python, machine-learning, pytorch, artificial-intelligence, huggingface-transformers | 1,749,425,227 |
se_79797798 | stackoverflow | MACHINE_LEARNING | Why does “Command Buffer Full” appear in PyTorch CUDA kernel launches? | Why does “Command Buffer Full” appear in PyTorch CUDA kernel launches?
I’m using the PyTorch profiler to analyze sglang, and I noticed that in the CUDA timeline, some kernels show “Command Buffer Full”. This causes the cudaLaunchKernel time to become very long, as shown in the attached screenshot.
I would like to unde... | https://stackoverflow.com/questions/79797798/why-does-command-buffer-full-appear-in-pytorch-cuda-kernel-launches | performance, pytorch, cuda, profiling, nvidia | 1,761,222,977 |
se_68018639 | stackoverflow | MACHINE_LEARNING | pip and trusted hosts | pip and trusted hosts
I am trying to install PyTorch 1.7.0 on Windows 10 using Python 3.8.6. When simply inputing the command
pip install torch==1.7+cu101
I get the error :
'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (... | https://stackoverflow.com/questions/68018639/pip-and-trusted-hosts | windows, pip, pytorch | 1,623,930,175 |
se_72639699 | stackoverflow | MACHINE_LEARNING | How can I fine-tune a masked language model? | How can I fine-tune a masked language model?
I'm trying to follow the Hugging Face tutorial on fine-tuning a masked language model (masking a set of words randomly and predicting them). But they assume that the dataset is in their system (can load it with from datasets import load_dataset; load_dataset("dataset_name")... | https://stackoverflow.com/questions/72639699/how-can-i-fine-tune-a-masked-language-model | machine-learning, pytorch, huggingface-transformers, transformer-model, huggingface-datasets | 1,655,345,312 |
se_74805446 | stackoverflow | MACHINE_LEARNING | How to hash a PyTorch Tensor | How to hash a PyTorch Tensor
Given a PyTorch Tensor of integers, for example, torch.Size(N, C, H, W).
Is there a way to efficiently hash each element of the tensor such that I get an output from [-MAX_INT32 to +MAX_INT32] or [0 to MAX_INT32] that fast runs on the GPU?
Also in a way I can perform output % N, and each e... | https://stackoverflow.com/questions/74805446/how-to-hash-a-pytorch-tensor | python, hash, pytorch, tensor | 1,671,062,089 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.