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/01/05 01:12:27 UTC

[GitHub] juliusshufan commented on a change in pull request #9305: Fixing two symbol files for CNN

juliusshufan commented on a change in pull request #9305: Fixing two symbol files for CNN
URL: https://github.com/apache/incubator-mxnet/pull/9305#discussion_r159793640
 
 

 ##########
 File path: example/image-classification/symbols/vgg.py
 ##########
 @@ -62,8 +62,12 @@ def get_symbol(num_classes, num_layers=11, batch_norm=False, dtype='float32', **
                 13: ([2, 2, 2, 2, 2], [64, 128, 256, 512, 512]),
                 16: ([2, 2, 3, 3, 3], [64, 128, 256, 512, 512]),
                 19: ([2, 2, 4, 4, 4], [64, 128, 256, 512, 512])}
-    if not vgg_spec.has_key(num_layers):
-        raise ValueError("Invalide num_layers {}. Possible choices are 11,13,16,19.".format(num_layers))
+    if sys.version_info > (3,):
+        if not num_layers in vgg_spec:
 
 Review comment:
   Hi,
   Thanks for reply.
   The has_key method will trigger a run time error at least for Python3.6. I therefore changes the script as this PR. 
   Thanks.
   

----------------------------------------------------------------
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