This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiprocessing as mp | |
import random | |
import sys | |
import zmq | |
def worker_proc(worker_addr, id_, proc_factory, proc_kwargs): | |
ctx = zmq.Context() | |
sock = ctx.socket(zmq.REQ) | |
sock.identity = f"woker_{id_}".encode() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The problem, | |
- PC was running 20.04 LTS, and one day PC can't shut down properly, had to manually force the shutdown (pressing the power btn). | |
- After that, PC lost nvidia-driver stuff (nvidia-smi can't work anymore), so need to reinstall drivers. | |
- The frustrating part is, tried so many different tutorials/versions, none worked. (e.g. apt update/upgrade/purge/remove/install whatever can be found online) | |
The fix, | |
- At last, decided to upgrade ubuntu to 22.04 LTS, and then simply `$ sudo apt install nvidia-driver-535`, reboot and done. | |
- One key reason why decided to upgrade is, all apt solutions tried are blocked by glibc version requirement (higher libc6 version is needed, but on 20.04 seems no such versions). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from concurrent.futures import ThreadPoolExecutor | |
import random | |
import requests | |
import time | |
def unit_task(data): | |
""" | |
For example, this function can be the requests.get for http response. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
from functools import partial | |
import json | |
import numpy as np | |
import os | |
from PIL import Image | |
import pylab as pl | |
import torch as th | |
from torch import nn | |
import torchvision as thv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import numpy as np | |
from matplotlib.gridspec import GridSpec | |
import numpy as np | |
import pylab as pl | |
from sklearn.neighbors import KernelDensity | |
def ridge_plot(groups, conf): | |
assert all([isinstance(el, dict) and all([k in el for k in ["name", "data"]]) for el in groups]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
import pylab as pl | |
import torch as th | |
from torch import nn, autograd as ag, optim | |
from torch.nn import functional as F | |
from sklearn import metrics | |
from sklearn.preprocessing import OneHotEncoder |