Skip to content

Instantly share code, notes, and snippets.

@whizzzkid
whizzzkid / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Last active December 3, 2022 15:43
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev
@Hiroshiba
Hiroshiba / copy_weights.py
Created December 23, 2016 17:26
copy chainer's layer weights to Keras' layer
def copy_weights_deconvolution(chainer_model, keras_model, layer_name):
deconv_chainer = chainer_model[layer_name]
W, b = (deconv_chainer.W.data, deconv_chainer.b.data)
keras_model.get_layer(layer_name).set_weights([numpy.transpose(W, (2, 3, 0, 1)), b])
def copy_weights_convolution(chainer_model, keras_model, layer_name):
conv_chainer = chainer_model[layer_name]
W, b = (conv_chainer.W.data, conv_chainer.b.data)
keras_model.get_layer(layer_name).set_weights([numpy.transpose(W, (2, 3, 1, 0)), b])