Skip to content

Commit

Permalink
wipe tqdm from everywhere, fix GAN and NN Honor
Browse files Browse the repository at this point in the history
  • Loading branch information
ZEMUSHKA committed Aug 11, 2018
1 parent 4bd3002 commit 8056d05
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 0 additions & 2 deletions download_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
# -*- coding: utf-8 -*-
import os
import shutil
import tqdm
import requests
import time
from functools import wraps
import traceback
tqdm.monitor_interval = 0 # workaround for https://github.com/tqdm/tqdm/issues/481
import tqdm_utils


Expand Down
1 change: 1 addition & 0 deletions tqdm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
import tqdm
tqdm.monitor_interval = 0 # workaround for https://github.com/tqdm/tqdm/issues/481


class SimpleTqdm():
Expand Down
8 changes: 5 additions & 3 deletions week2/NumpyNN (honor).ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
"source": [
"from __future__ import print_function\n",
"import numpy as np\n",
"np.random.seed(42)"
"np.random.seed(42)\n",
"import sys\n",
"sys.path.append(\"..\")\n",
"import tqdm_utils"
]
},
{
Expand Down Expand Up @@ -580,12 +583,11 @@
},
"outputs": [],
"source": [
"from tqdm import trange\n",
"def iterate_minibatches(inputs, targets, batchsize, shuffle=False):\n",
" assert len(inputs) == len(targets)\n",
" if shuffle:\n",
" indices = np.random.permutation(len(inputs))\n",
" for start_idx in trange(0, len(inputs) - batchsize + 1, batchsize):\n",
" for start_idx in tqdm_utils.tqdm_notebook_failsafe(range(0, len(inputs) - batchsize + 1, batchsize)):\n",
" if shuffle:\n",
" excerpt = indices[start_idx:start_idx + batchsize]\n",
" else:\n",
Expand Down
1 change: 0 additions & 1 deletion week3/week3_task2_fine_tuning_clean.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
"import scipy.io\n",
"import os\n",
"import tarfile\n",
"import tqdm\n",
"import keras_utils\n",
"from keras_utils import reset_tf_session "
]
Expand Down
6 changes: 3 additions & 3 deletions week4/Adversarial-task.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"import sys\n",
"sys.path.append(\"..\")\n",
"import grading\n",
"import download_utils"
"import download_utils\n",
"import tqdm_utils"
]
},
{
Expand Down Expand Up @@ -403,9 +404,8 @@
],
"source": [
"from IPython import display\n",
"from tqdm import tnrange\n",
"\n",
"for epoch in tnrange(50000):\n",
"for epoch in tqdm_utils.tqdm_notebook_failsafe(range(50000)):\n",
" \n",
" feed_dict = {\n",
" real_data:sample_data_batch(100),\n",
Expand Down
4 changes: 2 additions & 2 deletions week6/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import queue
import threading
import zipfile
import tqdm
import cv2
import numpy as np
import pickle
import tqdm_utils


def image_center_crop(img):
Expand Down Expand Up @@ -53,7 +53,7 @@ def apply_model(zip_fn, model, preprocess_for_model, extensions=(".jpg",), input

def reading_thread(zip_fn):
zf = zipfile.ZipFile(zip_fn)
for fn in tqdm.tqdm_notebook(zf.namelist()):
for fn in tqdm_utils.tqdm_notebook_failsafe(zf.namelist()):
if kill_read_thread.is_set():
break
if os.path.splitext(fn)[-1] in extensions:
Expand Down
1 change: 0 additions & 1 deletion week6/week6_final_project_image_captioning_clean.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"import matplotlib.pyplot as plt\n",
"L = keras.layers\n",
"K = keras.backend\n",
"import tqdm\n",
"import utils\n",
"import time\n",
"import zipfile\n",
Expand Down

0 comments on commit 8056d05

Please sign in to comment.