It is not trivial to compile pytorch on Fedora 26 as the gcc compiler 7.1.1 is not compatible with Cuda 8.0. This note describes a way around this problem.
Compile from source an old gcc version that is compatible with cuda. I used the latest version in the 5 series, 5.4.0 . The compiler source may be downloaded from: https://ftp.gnu.org/gnu/gcc/gcc-5.4.0/ . Note that this is quite a time consuming compilation.
Compile pytorch with the following command line:
Make sure that your PYTHONPATH includes the following two directories:
Test that everything works:
To install pytorch-vision apply the following path, whereupon pytorch-vision may be installed with a simple python setup.py install.