Skip to content

Instantly share code, notes, and snippets.

@raven4752
raven4752 / keras_limit.py
Last active February 2, 2023 13:42
limit gpu memory usage of keras
#put the these lines before importing any module from keras.
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.gpu_options.visible_device_list = "0" #only the gpu 0 is allowed
set_session(tf.Session(config=config))
@raven4752
raven4752 / ubuntu_enable_bbr.sh
Created March 24, 2018 14:56 — forked from Jamesits/ubuntu_enable_bbr.sh
Ubuntu enable BBR
#!/bin/bash
set -eu
SYSCTL_FILE=/etc/sysctl.d/90-tcp-bbr.conf
# check root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi