how to make nn.parameter() persists across parent classes ? in my coding: class Graph → class Cells → class nodes → class Connections → class Edge the nn.parameter() is located inside class Edge Source: Python..
I need to perform something similar to the built-in torch.argmax() function on a one-dimensional tensor, but instead of picking the index of the first of the maximum values, I want to be able to pick a random index of one of the maximum values. For example: my_tensor = torch.tensor([0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.1]) ..
I have a binary classification problem, and my main metric that I’m interested in is True Positive. For now I’m using the BCE loss but it’s not giving me good results. My question is that, is there a loss that helps in this direction, I was thinking of weighting my predictions using adapted weights, something ..
问题描述：本地测试时，通过 python3 可直接加载，完成使用，但在 /code 中 测试python3 L0CV_test.py，出现以下 debug log。 [libprotobuf FATAL google/protobuf/stubs/common.cc:87] This program was compiled against version 3.9.2 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.17.1). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the ..
I’m trying to use pytorch with my GPU (RTX 3070) on my Windows machine using WSL2, but I couldn’t get it work even though I followed the Nvidia guide (https://docs.nvidia.com/cuda/wsl-user-guide/index.html#abstract). nvidia-smi.exe output: +—————————————————————————–+ | NVIDIA-SMI 471.41 Driver Version: 471.41 CUDA Version: 11.4 | |——————————-+———————-+———————-+ | GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC ..
In the documentation for torch.rot90 it is stated that Rotation direction is from the first towards the second axis if k > 0, and from the second towards the first for k < 0. However say that we are rotating from axis 0 to axis 1, is axis 0 rotating to axis 1 in the ..
I have an input sequence in the form sequence_len x C x H x W = [10, 3, 16, 16] (Assuming batch size = 1). These are 10 images stacked together in a torch tensor. I wish to pass this to an MLP and obtain the next 10 as predictions from the MLP. The structure ..
I have a sparse array/tensor like below. import torch from torch_sparse import SparseTensor row = torch.tensor([0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3]) col = torch.tensor([1, 2, 3, 0, 2, 0, 1, 4, 5, 0, 2, 5, 2, 4]) value = torch.rand() adj_t = SparseTensor(row=row, col=col, value=value, sparse_sizes=(4, 9)) ..
I am using Pytracking package to apply image segmentation on videos. According to its instruction we need to execute the following: ! git clone https://github.com/visionml/pytracking.git %cd pytracking ! git submodule update –init ! bash install.sh conda_install_path pytrackingy When I execute the last line, I get the following error: ***************** Setting up environment ****************** Traceback (most ..
When running CLIP inside a multiprocessing.Process, the system hangs as soon as it reaches a preprocess step (in practice I assume this is actually any torch operation). A minimal example: import torch import clip from PIL import Image import multiprocessing as mp import sys device = "cuda" if torch.cuda.is_available() else "cpu" model, preprocess = clip.load("ViT-B/32", ..