Skip to content

Commit

Permalink
Add caffe2 nnvm frontend to CI (apache#3018)
Browse files Browse the repository at this point in the history
  • Loading branch information
hlu1 authored and Wei Chen committed May 13, 2019
1 parent e9466fb commit f141d34
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
13 changes: 6 additions & 7 deletions nnvm/tests/python/frontend/caffe2/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def get_tvm_output(model,
graph, lib, params = nnvm.compiler.build(
sym, target, shape=shape_dict, dtype=dtype_dict, params=params)

ctx = tvm.cpu(0)
m = graph_runtime.create(graph, lib, ctx)

# set inputs
Expand Down Expand Up @@ -89,21 +88,21 @@ def verify_caffe2_forward_impl(model, data_shape, out_shape):
tvm.testing.assert_allclose(c2_out, tvm_out, rtol=1e-5, atol=1e-5)


def verify_squeezenet1_1():
def test_squeezenet1_1():
verify_caffe2_forward_impl(c2_squeezenet, (1, 3, 224, 224),
(1, 1000, 1, 1))


def verify_resnet50():
def test_resnet50():
verify_caffe2_forward_impl(c2_resnet50, (1, 3, 224, 224),
(1, 1000))


def verify_vgg19():
def test_vgg19():
verify_caffe2_forward_impl(c2_vgg19, (1, 3, 224, 224), (1, 1000))


if __name__ == '__main__':
verify_squeezenet1_1()
verify_resnet50()
verify_vgg19()
test_squeezenet1_1()
test_resnet50()
test_vgg19()
7 changes: 5 additions & 2 deletions tests/scripts/task_python_frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# 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
Expand Down Expand Up @@ -50,6 +50,9 @@ python3 -m nose -v nnvm/tests/python/frontend/tensorflow
echo "Running nnvm CoreML frontend test..."
python3 -m nose -v nnvm/tests/python/frontend/coreml

echo "Running nnvm Caffe2 frontend test..."
python3 -m nose -v nnvm/tests/python/frontend/caffe2

echo "Running nnvm DarkNet frontend test..."
python3 -m nose -v nnvm/tests/python/frontend/darknet || exit -1

Expand Down

0 comments on commit f141d34

Please sign in to comment.