Skip to content

Instantly share code, notes, and snippets.

@tomrunia
tomrunia / tf_queue.py
Created November 2, 2016 14:48
TensorFlow queue example
# Initialize placeholders for feeding in to the queue
pl_queue_screens = tf.placeholder(tf.float32, shape=[config.seq_length, config.image_size, config.image_size, config.input_channels], name="queue_inputs")
pl_queue_targets = tf.placeholder(tf.uint8, shape=[config.seq_length], name="queue_targets_cnt")
# ...
capacity = config.min_after_dequeue + 10 * (config.num_gpus*config.batch_size)
q = tf.RandomShuffleQueue(
@katsugeneration
katsugeneration / iris_tensorflow.py
Created July 18, 2016 07:34
TensorFlow basic DNN
import tensorflow as tf
import numpy as np
import pandas as pd
import math
# Data sets
IRIS_TRAINING = "iris_training.csv"
IRIS_TEST = "iris_test.csv"
IRIS_DATA_SIZE = 4
CLASS_SIZE = 3
@davidthewatson
davidthewatson / ext.py
Created January 19, 2012 06:48
File upload with Flask
import os
from PIL import Image
from flask import Flask, request, redirect, url_for
from werkzeug import secure_filename
from flaskext.uploads import (UploadSet, configure_uploads, IMAGES,
UploadNotAllowed)
app = Flask(__name__)
app.config['UPLOADED_PHOTOS_DEST'] = '/tmp/testuploadext'