Skip to content

Instantly share code, notes, and snippets.

mattiasarro /
Last active May 27, 2024 09:17
# Taken from
# I've added additional comments restructured it a tiny bit, which makes it clearer for me.
import numpy as np
from torch import load as torch_load # Only for loading the model weights
from tokenizers import Tokenizer
exp = np.exp
layer_norm = lambda x, w, b : (x - np.mean(x)) / np.std(x) * w + b
sigmoid = lambda x : 1/(1 + exp(-x))
mattiasarro /
Last active August 24, 2022 15:24 — forked from orpcam/
Install Tensorflow 1.6 on macOS High Sierra 10.13.3 with GPU Acceleration (without disabling SIP)

Tensorflow 1.6 on macOS High Sierra 10.13.3 with GPU Acceleration (without disabling SIP)

This gist (based on a blog post at documents how to set up TensorFlow 1.6 with (e)GPU support without the need to disable SIP. Following the original gist got me a saystem in which training TF on eGPU was successful, but there were various visual glitches due to the newer / less stable version of the driver.

As pointed out by ronchigram, many people are having issues with newer NVIDIA drivers, so it's worth using the nvidia-update script by Benjamin Dobell that installs the latest stable NVIDIA web driver, and if necessary patches it to run on your system. We also don't need to disable SIP when using nvidia-update.

I have als

INFO: From Compiling tensorflow/core/kernels/
./tensorflow/core/lib/core/status.h(32): warning: attribute "warn_unused_result" does not apply here
./tensorflow/core/framework/variant.h(343): error: constexpr constructor calls non-constexpr function "std::__1::unique_ptr<_Tp, _Dp>::unique_ptr() [with _Tp=tensorflow::Variant::ValueInterface, _Dp=std::__1::default_delete<tensorflow::Variant::ValueInterface>]"
1 error detected in the compilation of "/var/folders/_8/__mwc41n7kq1__sy9mdkz3c80000gn/T//".
ERROR: /Users/m/code/3rd/tensorflow_1_4/tensorflow/core/kernels/BUILD:3230:1: output 'tensorflow/core/kernels/_objs/fused_batch_norm_util_gpu/tensorflow/core/kernels/' was not created.
ERROR: /Users/m/code/3rd/tensorflow_1_4/tensorflow/core/kernels/BUILD:3230:1: not all outputs were created or valid.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the
mattiasarro / tensorflow_configure.txt
Last active April 10, 2019 09:06
Example ./configure for TensorFlow (with GPU support) 1.2 on macOS
› ./configure
Please specify the location of python. [Default is /Users/m/code/3rd/conda/envs/p3gpu/bin/python]:
Found possible Python library paths:
Please input the desired Python library path to use. Default is [/Users/m/code/3rd/conda/envs/p3gpu/lib/python3.6/site-packages]
Using python library path: /Users/m/code/3rd/conda/envs/p3gpu/lib/python3.6/site-packages
Do you wish to build TensorFlow with MKL support? [y/N] N
No MKL support will be enabled for TensorFlow
# Authors: Daniyal Shahrokhian, Mattias Arro
import numpy as np
from scipy.stats import bernoulli
# Generates n points(labels) accodring to the distribution of the exercise
def gen_points(x_values):
points = []
for x in x_values:
Cluster 0 words:
Cluster 0 tweets:
Top terms per cluster:
Cluster 0 words:
k1 = function(str) { key = OSX.keyCodes[str]; e = $.CGEventCreateKeyboardEvent(null, key, true); $.CGEventPost($.kCGSessionEventTap, e)}; k2 = function(str) { key = OSX.keyCodesRegular[str]; e = $.CGEventCreateKeyboardEvent(null, key, true); $.CGEventPost($.kCGSessionEventTap, e)}; k3 = function(str) { key = OSX.keyCodesShift[str]; e = $.CGEventCreateKeyboardEvent(null, key, true); $.CGEventPost($.kCGSessionEventTap, e)}
diff --git a/app/models/ticketing/ticket_transaction.rb b/app/models/ticketing/ticket_transaction.rb
index 50b3a3c..3a6ea7d 100644
--- a/app/models/ticketing/ticket_transaction.rb
+++ b/app/models/ticketing/ticket_transaction.rb
@@ -48,12 +48,20 @@ class TicketTransaction < ActiveRecord::Base
def state_cleared
+ complete! unless require_guest_names
[vagrant@vagrant-centos-6 vagrant]$ rake sphinx:stop
Booting asw-api in development environment
Braintree transactions will run in sandbox mode
Skipping migrations check - have you remembered to run migrations recently?
PayPal transactions will run in sandbox mode
Pensio transactions will run in sandbox mode
Setting Resque to use Redis server at localhost:6379
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Stopping - Dispatcher... couldn't find PID file - no action taken.
Stopping - Delta Script... couldn't find PID file - no action taken.