You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/28 04:54:50 UTC

[GitHub] xinyu-intel commented on a change in pull request #10391: [MXNET-139] Tutorial for mixed precision training with float16

xinyu-intel commented on a change in pull request #10391: [MXNET-139] Tutorial for mixed precision training with float16
URL: https://github.com/apache/incubator-mxnet/pull/10391#discussion_r198707423
 
 

 ##########
 File path: example/image-classification/benchmark_score.py
 ##########
 @@ -74,11 +75,17 @@ def score(network, dev, batch_size, num_batches):
     devs.append(mx.cpu())
 
     batch_sizes = [1, 2, 4, 8, 16, 32]
-
     for net in networks:
         logging.info('network: %s', net)
         for d in devs:
             logging.info('device: %s', d)
             for b in batch_sizes:
-                speed = score(network=net, dev=d, batch_size=b, num_batches=10)
-                logging.info('batch size %2d, image/sec: %f', b, speed)
+                for dtype in ['float32', 'float16']:
+                    if d == mx.cpu() and dtype == 'float16':
+                        #float16 is not supported on CPU
+                        continue
+                    elif net in ['inception-bn', 'alexnet'] and dt == 'float16':
 
 Review comment:
   I guess this `dt` here doesn't work, please check again. By the way, it's necessary to add a logging here to notice user what the dtype is.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services