marcoabreu commented on a change in pull request #11626: [MXNET-651] MXNet 
Model Backwards Compatibility Checker
URL: https://github.com/apache/incubator-mxnet/pull/11626#discussion_r202281614
 
 

 ##########
 File path: 
tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py
 ##########
 @@ -0,0 +1,168 @@
+#!/usr/bin/env python
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from common import *
+
+def test_module_checkpoint_api():
+       model_name = 'module_checkpoint_api'
+       print ('Performing inference for model/API %s' %model_name)
+       data = download_data_from_s3(model_name)
+       test_data = data['data']
+       test_label = data['labels']
+
+       data_iter = mx.io.NDArrayIter(test_data, test_label, batch_size=10)
+
+       ## For each MXNet version that has the saved models
+       for folder in get_top_level_folders_in_bucket(s3, model_bucket_name):
+               bucket = s3.Bucket(model_bucket_name)
+               prefix = folder + backslash + model_name
+               model_files_meta = list(bucket.objects.filter(Prefix = prefix))
+               if len(model_files_meta) == 0:
+                   print ('No trained models found under path : %s' %prefix)
+                   continue
+               model_files = list()
+               ## For each file found under a model folder : 
+               for obj in model_files_meta:
+                   file_name = obj.key.split('/')[2]
+                   model_files.append(file_name)
+                   ## Download this file---
+                   bucket.download_file(obj.key, file_name)
 
 Review comment:
   where this it download the file to?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to