Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "cells": [
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import tensorflow as tf"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "#output random values from a truncated normal distribution\n",
- "a = tf.truncated_normal([16,128,128,3])"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "sess = tf.Session()\n",
- "sess.run(tf.initialize_all_variables())\n",
- "sess.run(tf.shape(a)) #create a in session"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "b = tf.reshape(a,[16,49152])\n",
- "sess.run(tf.shape(b))"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "################ starting point ###############\n",
- "import cv2\n",
- "import numpy as np\n",
- "import os\n",
- "from random import shuffle\n",
- "from tqdm import tqdm"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "TRAIN_DIR = 'C:/Users/Awannaphasch2016/Documents/tensorflow cat and dog/train'\n",
- "TEST_DIR = 'C:/Users/Awannaphasch2016/Documents/tensorflow cat and dog/test1'"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "IMG_SIZE = 50\n",
- "LR = 1e-3 # what is this ?? \n",
- "#just so we remember which saved model is which, sized must match\n",
- "#to call\n",
- "MODEL_NAME = 'dogvscats-{}-{}.model'.format(LR, '2conv-basic')"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.6.5"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
- }
Add Comment
Please, Sign In to add comment