Hello,
l have installed pytorch as follow :
git clone https://github.com/pytorch/pytorch.git && cd pytorch/
python setup.py install
It have been installed successfully.
these commands works :
import torch
from torch.utils.data import Dataset
from torch.utils.data import sampler
However :
import torchvision.transforms as transforms
gives me back the following error :
ImportError: No module named torchvision.transforms
What’s missing ?
THANK YOU
Torch
Build PyTorch from source
RUN git clone https://github.com/pytorch/pytorch.git
&& cd pytorch
&& git checkout 4eb448a051a1421de1dda9bd2ddfb34396eb7287
&& TORCH_CUDA_ARCH_LIST=“3.5 5.2 6.0 6.1+PTX”
TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
python setup.py install
&& rm -rf pytorch
Build torch-vision from source
RUN git clone https://github.com/pytorch/vision.git
&& cd vision
&& git checkout 83263d8571c9cdd46f250a7986a5219ed29d19a1
&& python setup.py install
&& rm -rf vision
Thanks a lot @QuantScientist . It works. However, l didn’t install “Build torch-vision from source” l just installed pytorch “Build PyTorch from source” then import torchvision.transforms as transforms
works. It’s strange
finlouarn
(Sebastien)
October 11, 2017, 1:06pm
5
git checkout worked properly but while setting up
TORCH_CUDA_ARCH_LIST=“3.5 5.2 6.0 6.1+PTX”
5.2: command not found
There is an updated script here:
# PyTorch GPU and CPU
# If you dont have CUDA installed, run this first:
# https://github.com/QuantScientist/Deep-Learning-Boot-Camp/blob/master/docker/deps_nvidia_docker.sh
#GPU version
export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
export CUDA_BIN_PATH=/usr/local/cuda
export CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0
# Build PyTorch from source
git clone https://github.com/pytorch/pytorch.git
cd pytorch
git submodule update --init
#git checkout 4eb448a051a1421de1dda9bd2ddfb34396eb7287
export TORCH_CUDA_ARCH_LIST="3.5 5.2 6.0 6.1+PTX"
This file has been truncated. show original