Skip to content

Instantly share code, notes, and snippets.

View 0leynik's full-sized avatar

Oleynik Dmitry 0leynik

View GitHub Profile
@0leynik
0leynik / remove-all-from-docker.sh
Created September 7, 2021 07:59 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@0leynik
0leynik / building_tensorflow.md
Created April 2, 2021 05:52 — forked from kmhofmann/building_tensorflow.md
Building TensorFlow from source

Building TensorFlow from source (TF 2.3.0, Ubuntu 20.04)

Why build from source?

The official instructions on installing TensorFlow are here: https://www.tensorflow.org/install. If you want to install TensorFlow just using pip, you are running a supported Ubuntu LTS distribution, and you're happy to install the respective tested CUDA versions (which often are outdated), by all means go ahead. A good alternative may be to run a Docker image.

I am usually unhappy with installing what in effect are pre-built binaries. These binaries are often not compatible with the Ubuntu version I am running, the CUDA version that I have installed, and so on. Furthermore, they may be slower than binaries optimized for the target architecture, since certain instructions are not being used (e.g. AVX2, FMA).

So installing TensorFlow from source becomes a necessity. The official instructions on building TensorFlow from source are here: ht

@0leynik
0leynik / installing_nvidia_driver_cuda_cudnn_linux.md
Created April 2, 2021 05:52 — forked from kmhofmann/installing_nvidia_driver_cuda_cudnn_linux.md
Installing the NVIDIA driver, CUDA and cuDNN on Linux

Installing the NVIDIA driver, CUDA and cuDNN on Linux (Ubuntu 20.04)

This is a companion piece to my instructions on building TensorFlow from source. In particular, the aim is to install the following pieces of software

on an Ubuntu Linux system, in particular Ubuntu 20.04.

@0leynik
0leynik / add_to_dict.py
Created September 16, 2019 14:01
Add word or words to dictionary file in txt-format
import sys
import re
import os
add_mode = sys.argv[1]
if add_mode == '--word':
words = [sys.stdin.read().strip()]
elif add_mode == '--words':
split_pattern = r'[\ \,\.\:\;\!\?\(\)\{\}\[\]\\\/\|\<\>\$\%\*]+'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0leynik
0leynik / pyplot_figsize_dpi_test.ipynb
Last active May 16, 2019 11:14
Testing dependencies between pyplot figsize and dpi on plot and image
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0leynik
0leynik / download-and-upload-files-with-googledrive.ipynb
Last active October 29, 2020 01:14
Download and upload files with GoogleDrive
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(function(){
'use strict';
if (!confirm('Delete?')) return;
//posts
//var deletePostLink = document.body.querySelectorAll('a.ui_actions_menu_item[onclick^="wall.deletePost"]');
//gifts
// var deletePostLink = document.body.querySelectorAll('a.gift_delete[onclick^="Gifts.deleteGift"]');
@0leynik
0leynik / ManualHough.py
Created August 16, 2018 07:14 — forked from ri-sh/ManualHough.py
Hough Lines from scratch using opencv and numpy
# imports
import numpy as np
import cv2
import matplotlib.pyplot as plt
# The Hough Transform is a popular algorithm for detecting any shape that can
# be represented in a parametric mathmatical form in binary images. This
# usually means that images need to be thresholded or filtered prior to running
The error I get:
/usr/bin/ld: cannot find -lopenblas
collect2: error: ld returned 1 exit status
Makefile:568: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
The changes I made:
Makefile.config
#INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include