File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
sagemaker-python-sdk/tensorflow_resnet_cifar10_with_tensorboard Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 2
2
import sys
3
3
import tarfile
4
4
from six .moves import urllib
5
+ from ipywidgets import FloatProgress
6
+ from IPython .display import display
5
7
6
8
DATA_URL = 'https://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz'
7
9
@@ -19,11 +21,13 @@ def cifar10_download(data_dir='/tmp/cifar10_data', print_progress=True):
19
21
filepath = os .path .join (data_dir , filename )
20
22
21
23
if not os .path .exists (filepath ):
24
+ f = FloatProgress (min = 0 , max = 100 )
25
+ display (f )
26
+ sys .stdout .write ('\r >> Downloading %s ' % (filename ))
27
+
22
28
def _progress (count , block_size , total_size ):
23
29
if print_progress :
24
- sys .stdout .write ('\r >> Downloading %s %.1f%%' % (
25
- filename , 100.0 * count * block_size / total_size ))
26
- sys .stdout .flush ()
30
+ f .value = 100.0 * count * block_size / total_size
27
31
28
32
filepath , _ = urllib .request .urlretrieve (DATA_URL , filepath , _progress )
29
33
print ()
You can’t perform that action at this time.
0 commit comments