Ubuntu Pytorch without NVDIA (AMD FUCK)

Config ss proxy

sudo apt-get install shadowsocks-libev

config file

mkdir ssr && cd $_
vi ss.json
{
"server":"199.168.137.20",
"server_port":*,
"local_port":1081,
"password":"*",
"timeout":600,
"method":"aes-256-gcm"
}
:wq

install privoxy

sudo apt install privoxy
sudo gedit /etc/privoxy/config

put this at first line (dont forget the dot in the end of line)

forward-socks5 / 127.0.0.1:1081 . 

press ctrl-s


vi ~/.bashrc 

function proxy_off(){
    unset http_proxy
    unset https_proxy
    unset ftp_proxy
    unset rsync_proxy
    echo -e "已关闭代理"
}   

function proxy_on() {
    export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
    export http_proxy="http://127.0.0.1:8118"
    export https_proxy=$http_proxy
    export ftp_proxy=$http_proxy
    export rsync_proxy=$http_proxy
    export HTTP_PROXY=$http_proxy
    export HTTPS_PROXY=$http_proxy
    export FTP_PROXY=$http_proxy
    export RSYNC_PROXY=$http_proxy
    echo -e "已开启代理"
}
:wq
source ~/.bashrc 
service privoxy restart
wget google.com
===>index.html

miniconda

download the installer

https://docs.conda.io/en/latest/miniconda.html

bash Miniconda3-latest-Linux-x86_64.sh

close terminal
open terminal

conda -V
conda 4.7.12

pytorch

https://pytorch.org/get-started/locally/

conda install pytorch torchvision cpuonly -c pytorch
y
* very fucking slow

if you are slow too:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
proxy_off
conda install pytorch torchvision cpuonly -c pytorch

if it's still slow too, like me. take a shower and await it get crash.(QwQ)

vi test.py

from __future__ import print_function
import torch
x = torch.rand(5, 3)
print(x)

---
:wq
python test.py
tensor([[0.7863, 0.7570, 0.2269],
        [0.5199, 0.4517, 0.6182],
        [0.0156, 0.7750, 0.0581],
        [0.8170, 0.8023, 0.8132],
        [0.9738, 0.9165, 0.3282]])

This means it's ok.

发表留言

本站启用了垃圾评论检测插件,如果误删请联系我~