Conda list shows a package but cannot import it

Here an issue i'm having on a conda Virtual env. I'm using ubuntu 64b guest on windows 7 host with Virtual Box. So when i'm doing : source activate MyVirtEnv conda list |grep visdom visdom ...

PyTorch Cuda with anaconda not available

I'm using anaconda to regulate my environment, for a project i have to use my GPU for network training. I use pytorch for my project and i'm trying to get CUDA working. I installed cudatoolkit,...

PyTorch - Getting the 'TypeError: pic should be PIL Image or ndarray. Got <class 'numpy.ndarray'>' error

I am getting the error TypeError: pic should be PIL Image or ndarray. Got <class 'numpy.ndarray'> when I try to load a non-image dataset through the DataLoader. The versions of torch and...

Transfer learning in Pytorch using fasterrcnn_resnet50_fpn

I am looking for Object Detection for custom dataset in PyTorch. Tutorial here provides a snippet to use pre-trained model for custom object classification model_ft =...

Can't import torch in jupyter notebook

System: macOS 10.13.6 Python: 3.7 Anaconda3 I have trouble when import torch in jupyter notebook. ModuleNotFoundError: No module named 'torch' Here is how I install pytorch: conda install...

RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same

I am trying to train the following CNN as follows, but I keep getting the same error regarding .cuda() and I am not sure how to fix it. Here is a chunk of my code so far. import matplotlib.pyplot...

How to specify pytorch / cuda version in pipenv

I am trying to install a specific version of pytorch that is compatible with a specific cuda driver version with pipenv. The pytorch website shows how to to this with pip: pip3 install...

Why `torch.cuda.is_available()` returns False even after installing pytorch with cuda?

On a Windows 10 PC with an NVidia GeForce 820M I installed CUDA 9.2 and cudnn 7.1 successfully, and then installed PyTorch using the instructions at pytorch.org. Specifically I used the...

No matching distribution found for torch==1.5.0+cpu on Heroku

I am trying to deploy my Django app which uses a machine learning model. And the machine learning model requires pytorch to execute. When i am trying to deploy it is giving me this error ERROR:...

trouble importing Pytorch in Jupyter notebook

Iam new to deep learning and Iam trying to import Pytorch on Jupyter Notebook. I installed Pytorch with the following lines of code in Anaconda Prompt. conda create -n pytorch_p37 python=3.7 conda...

Installing PyTorch3D fails with anaconda and pip

I saw that more people seem to have the same issue, but it was not resolved. I am trying to install Pytorch3D with Anaconda and got the following PackageNotFound error. Collecting package metadata...

OSError: [E050] Can't find model 'de'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory

So I am trying to make a seq to seq model for translating german to english using pytorch on online notebook like kaggle notebook and google colab import torch import torch.nn as nn import...

ImportError: TensorBoard logging requires TensorBoard version 1.15 or above

I follow the tutorials in pytorch.org It occurs error:TensorBoard logging requires TensorBoard version 1.15 or above,but I have install TensorBoard already. Here is the code: #from...

Runtimeerror: Cuda out of memory - problem in code or gpu?

I am currently working on a computer vision project. I keep getting a runtime error that says "CUDA out of memory". I have tried all possible ways like reducing batch size and image resolution,...

can't open new notebook with particular kernel

I have a jupyter notebook server with multiple kernels. every time I try to start a new notebook with my deepdow2 kernel it hangs for a long time and ultimately the connection fails with: "A...

How to load a dataset of images starting from list of images Pytorch

I have a service that receives images in a binary format from another service (let's call it service B): from PIL import Image img_list = [] img_bin = get_image_from_service_B() image =...

not able to install easyocr (pytorch error)

I am trying to install easyocr for python using pip pip install easyocr but it's not installing its givig me this in the terminal ERROR: torchvision 0.5.0 has requirement torch==1.4.0, but...

PyTorch Tutorial freeze_support() issue

I tried following the tutorial from PyTorch here: https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html#sphx-glr-beginner-blitz-cifar10-tutorial-py. Full code is here: import...

Pytorch cuda version can not install

In the beginning, I checked my cuda version using nvcc --version command and it shows version as 10.2 So i started to install pytorch with cuda based on instruction in pytorch so I tried with...

How to replicate PyTorch normalization in OpenCV or NumPy?

I need to replicate PyTorch image normalization in OpenCV or NumPy. Quick backstory: I'm doing a project where I'm training in PyTorch but will have to inference in OpenCV due to deploying to an...

Torch distributed broadcast and reduce between CPU/ GPU devices

Using the torch.distributed package. I am trying to move tensors from CPU -> GPU0, GPU1 in two separate processes and update the master version (on CPU). Assume I have two GPU's connected. One on...

How to convert custom Pytorch model to torchscript (pth to pt model)?

I trained a custom model with pytorch using colab environment. I was able to successfully save the trained model to Google Drive with the name model_final.pth . I want to convert model_final.pth...

How to calculate the mean and the std of cifar10 data

Pytorch is using the following values as the mean and std for the cifar10 data: transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)) I need to understand the concept behind calculating it...

After installing Pytorch cuda , torch.cuda.is_available() show false. What to do?

I have installed pytorch cuda by running this command: conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia My cuda version is 11.2 . I am using windows 10 . Pytorch...

RuntimeError: No CUDA GPUs are available

I want to train a gpt2 model in my laptop and I have a GPU in it and my os is windows , but I always got this error in python: torch._C._cuda_init() RuntimeError: No CUDA GPUs are available when...

How to get onnx format from pretrained GPT2 models?

I'm trying to transform KoGPT2 model, which is pretrained by GPT2, to onnx format in order to change the model to tensorflow format. I used convert_graph_to_onnx in transformers but it didn't work...

Unexpected input data type. Actual: (tensor(double)) , expected: (tensor(float))

I am learning this new ONNX framework that allows us to deploy the deep learning (and others) model into production. However, there is one thing I am missing. I thought that the main reason for...

pytorch torchvision.datasets.ImageFolder FileNotFoundError: Found no valid file for the classes .ipynb_checkpoints

Tried to load training data with pytorch torch.datasets.ImageFolder in Colab. transform = transforms.Compose([transforms.Resize(400), ...

ImportError: Could not find the DLL(s) 'msvcp140.dll or msvcp140_1.dll'. Even when the files are located in the %PATH% directory

I receive the following error when importing tensorflow (base) PS C:\Users\Rostyslav\GIt\GNN-GCP> python run_model.py --train --save Traceback (most recent call last): File "run_model.py", line...

Can't install Pytorch in Pycharm terminal, Python 3.10 .win 10

I go to pytorch site and take this pip3 install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio===0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html I have windows...