Skip to content

Instantly share code, notes, and snippets.

View mikaelhg's full-sized avatar
🏠
Working from home

Mikael Gueck mikaelhg

🏠
Working from home
View GitHub Profile
@mikaelhg
mikaelhg / mnist_quant.py
Last active December 13, 2019 16:02
TF 2 tflite quantization and int8
import os
import pathlib
import tensorflow as tf
import logging
## --------------------------------------------------------------------------------
# Configure
physical_devices = tf.config.experimental.list_physical_devices('GPU')
assert len(physical_devices) > 0, "No GPUs found"
@mikaelhg
mikaelhg / wakeup.txt
Created November 29, 2019 12:32
wakeup requires menu click xfce4
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781288;msg=37
$ apt-get remove light-locker
@mikaelhg
mikaelhg / docker-run.txt
Created October 30, 2019 13:36
Docker NVidia Tensorflow shm settings
docker run --gpus all -it --rm --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 nvcr.io/nvidia/tensorflow:19.10-py3 nvidia-smi
@mikaelhg
mikaelhg / 01_error.md
Last active October 26, 2019 10:04
Tensorflow 1.15.0 "The minimum required Cuda capability is 6.0."

The Google official Java build in Maven Central is broken, and has been for quite a while.

Environment: AWS P2.xlarge instance with a K80 GPU and CUDA compute capability of 3.7.

Error: "Ignoring visible gpu device [...] The minimum required Cuda capability is 6.0."

Expected: The minimum CUDA compute capability is 3.5, like the documents state, and as the Python packages require.

https://www.tensorflow.org/install/gpu

@mikaelhg
mikaelhg / zgc.log
Created October 4, 2019 14:44
ZGC GC log on Java 14 EA
[100.079s][info][gc,stats ] === Garbage Collection Statistics =======================================================================================================================
[100.079s][info][gc,stats ] Last 10s Last 10m Last 10h Total
[100.079s][info][gc,stats ] Avg / Max Avg / Max Avg / Max Avg / Max
[100.079s][info][gc,stats ] Collector: Garbage Collection Cycle 0.000 / 0.000 55.908 / 77.566 55.908 / 77.566 55.908 / 77.566 ms
[100.079s][info][gc,stats ] Contention: Mark Segment Reset Contention 0 / 0 0 / 0 0 / 0 0 / 0 ops/s
[100.079s][info][gc,stats ] Contention: Mark SeqNum Reset Contention 0 / 0 0 / 0 0 / 0
#!/bin/bash
export JAVA_HOME="${HOME}/local/jdk-11"
export PATH="${JAVA_HOME}/bin":$PATH
$@
@mikaelhg
mikaelhg / fix.txt
Created January 19, 2019 09:57
IDEA Z-order focus stealing
-Dsuppress.focus.stealing=false
https://youtrack.jetbrains.com/issue/IDEA-196933#focus=streamItem-27-3252588-0-0
@mikaelhg
mikaelhg / detection_thread.py
Created October 4, 2018 16:57
Minimal Tensorflow object detection example
import warnings
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=FutureWarning)
import h5py
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
import tensorflow as tf
@mikaelhg
mikaelhg / pyav_streamlink_youtube_live.py
Created September 5, 2018 18:35
Using PyAV and Streamlink to decode Youtube Live HLS streams
@mikaelhg
mikaelhg / NVIDIA_DKMS_CLANG.md
Created August 19, 2018 23:27
clang, dkms and ERROR: could not insert 'nvidia': Exec format error

When DKMS uses clang to compile the nvidia kernel driver, you're boned.

sudo modprobe nvidia
modprobe: ERROR: could not insert 'nvidia': Exec format error

Unfortunately, dkms doesn't take CC and CXX settings from the environment.