24,326 questions
0
votes
1
answer
28
views
cannot solve Error 101: invalid device ordinal
we have one server with 5 old gpus (nvidia titan xp * 5).
when execute the code x.to("cuda") and get the following error, but torch.cuda.device_count() can correctly return 5.
RuntimeError: ...
0
votes
1
answer
30
views
torch round to two significant digits?
I have jupyter notebook mess that I am attempting to refactor into proper unit tests. I would like to copy-paste some output from actual data into my test cases. However, my data are long gnarly ...
-5
votes
0
answers
71
views
Regex logic in numpy/torch [closed]
Morning,
This is a kinda 'open question'.
Is there a way to find number sequences, following certain pattern, in a numpy/torch array in a similar way as a regex works?
Let's say i wanna find all ...
2
votes
0
answers
70
views
Creating Venv fails due to ModuleNotFoundError: No module named 'torch'
I have cloned this Github repo into VSCode in order to start a new project. While trying to create a virtual environment with venv, VSCode detected the requirements.txt and asked me for permission to ...
1
vote
1
answer
62
views
What is the equivalent of torch.nn.Parameter(...) in julia's flux?
In pytorch I can create a custom module as follows (this code example is taken from here):
from torch import nn
class MyModel(nn.Module):
def __init__(self):
super().__init__()
...
-1
votes
0
answers
31
views
PyTorch High Train Loss and Test Loss
So I'm using a CNN with 3 Conv layers with FGVCAircraft Dataset but my loss is so much higher than I expected and I don't know why.Here is the code of my CNN:
from torch import nn
class MNIST_model(nn....
0
votes
0
answers
31
views
subprocess.CalledProcessError: Command '['ninja']' returned non-zero exit status 1
how to resolve this error
[SPARSE] Backend: spconv, Attention: flash_attn
/usr/local/lib/python3.11/dist-packages/gradio_client/utils.py:1097: UserWarning: file() is deprecated and will be removed in ...
0
votes
1
answer
53
views
PyTorch with Docker issues: torch.cuda.is_available() = False
I'm having an issue with PyTorch in a Docker container where torch.cuda.is_available() returns False, but the same PyTorch version works correctly outside the container.
Environment
Host: Debian 12
...
-1
votes
0
answers
26
views
How could I extract parameter p, r of negative binomial distribution in pytorch?
Based on the code here,
I was trying to perform demand prediction, changing loss function to negative binomial distribution.
In that process, I was wondering how I could extract the parameter for r, p ...
0
votes
0
answers
35
views
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 ...
0
votes
0
answers
24
views
Mismatch between PyTorch inference and manual implementation
I’m trying to manually reproduce the inference forward-pass to understand exactly how quantized inference works. To do so, I trained and quantized a model in PyTorch using QAT, manually simulate the ...
0
votes
1
answer
46
views
How to reduce GPU memory usage when running Stable Diffusion with HuggingFace Diffusers?
I'm trying to run Stable Diffusion using HuggingFace's diffusers library, but I keep getting CUDA out of memory errors on my RTX 3060 (12GB VRAM). I'm using the standard StableDiffusionPipeline from ...
0
votes
0
answers
21
views
Can I use test-time training with audio augmentations (like noise classification) for a CNN-BiGRU CTC phoneme model?
I have a model for speech audio-to-phoneme prediction using CNN and bidirectional GRU layers. The phoneme vector is optimized using CTC loss. I want to add test-time training with audio augmentations. ...
1
vote
0
answers
24
views
Why is day_size set to 32 in temporal embedding code?
I am trying to understand the code for temporal embedding inside autoformer implementation using pytorch.
https://github.com/thuml/Autoformer/blob/main/layers/Embed.py
class TemporalEmbedding(nn....
-2
votes
1
answer
35
views
Fine-tuning a model with the Trainer API | TypeError: object of type 'NoneType' has no len()
I am using hugging face Trainer API.
transformers version==4.31.0
torch==2.0.1
accelerate==0.27.0
I'm trying to fine-tune a TimeSformer model for video classification using the Hugging Face ...