Skip to content
Advertisement

Tag: pytorch

CPU only pytorch is crashing with error AssertionError: Torch not compiled with CUDA enabled

I’m trying to run the code from this repository and I need to use Pytorch 1.4.0. I’ve installed the CPU only version of pytorch with pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html. I ran the program by doing py -m train_Kfold_CV –device 0 –fold_id 10 –np_data_dir “C:UsersusernameOneDriveDesktopemadeldeenAttnSleepprepare_datasetsedf_20_npz” but I’m getting this error: I’ve changed the number of GPU in the config

How can I get torch-geometric to work using Nix?

I am trying to get the Python package torch-geometric to work using Nix (I am on NixOS). Currently, I use mach-nix to try and setup a Python environment. However, the difficulty is that some of the dependencies should be downloaded from a separate file server (not pypi), i.e. https://pytorch-geometric.com/whl/torch-1.8.0+cpu.html. I am first trying to setup an environment containing a single

How do I use the exported ‘best.pt” file from yolov5 colab file to run the trained weights locally?

I have trained my model using yoloV5 on google colab, following the provided tutorial and walkthrough provided for training any custom model: Colab file for training your own custom model. I now have an exported best.pt file after running the last cell in the link provided. Now, I want to make use of this trained weight to run a detection

IndexError: Target 1 is out of bounds

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), Batch size is 1 I am new to PyTorch, thanks. Error: Answer This

I want to train the CSRNet model on UCF_CC_50 dataset which has total number of images 50. and face a problem like

I want to train the CSRNet model on UCF_CC_50 dataset but occurring this problem The file path is C:UsersGigabyte pcDesktopCOUNTINGCSRNet-pytorch-masterUCF_CC_50part_A_final/train_dataimagesIMG_1.jpg Answer Your code does not comply with the structure of the annotation file you are trying to read. Annotations in UCF-50 CC dataset can simply be read by getting the values of the key “annPoints”. You could apply the following

How to create n-dimensional sparse tensor? (pytorch)

I want to initialize tensor to sparse tensor. When tensor’s dimensional is 2, I can use torch.nn.init.sparse(tensor, sparsity=0.1) Result But when tensor dimensions > 2, this function isn’t work. Result I need this because I want to use it to initialize the convolution weights. torch.nn.init.sparse_() function’s def is below How could I make n-dimensional sparse tensor? Is there a way

Advertisement