<s> from __future__ import absolute_import <EOL> from . caffe_train import CaffeTrainTask , CaffeTrainSanityCheckError <EOL> from google . protobuf import text_format <EOL> from digits . config import config_value <EOL> import caffe <EOL> import caffe_pb2 <EOL> def check_positive ( desc , stage ) : <EOL> network = caffe_pb2 . NetParameter ( ) <EOL> text_format . Merge ( desc , network ) <EOL> CaffeTrainTask . net_sanity_check ( network , stage ) <EOL> def check_negative ( desc , stage ) : <EOL> network = caffe_pb2 . NetParameter ( ) <EOL> text_format . Merge ( desc , network ) <EOL> try : <EOL> CaffeTrainTask . net_sanity_check ( network , stage ) <EOL> except CaffeTrainSanityCheckError : <EOL> pass <EOL> class TestCaffeNetSanityCheck ( ) : <EOL> def test_std_net_train ( self ) : <EOL> desc = """<STR_LIT>""" <EOL> check_positive ( desc , caffe_pb2 . TRAIN ) <EOL> def test_std_net_deploy ( self ) : <EOL> desc = """<STR_LIT>""" <EOL> check_positive ( desc , caffe_pb2 . TEST ) <EOL> def test_ref_label_with_proper_include_directive ( self ) : <EOL> desc = """<STR_LIT>""" <EOL> check_positive ( desc , caffe_pb2 . TEST ) <EOL> def test_ref_label_with_proper_exclude_directive ( self ) : <EOL> desc = """<STR_LIT>""" <EOL> check_positive ( desc , caffe_pb2 . TEST ) <EOL> def test_error_ref_label_in_deploy ( self ) : <EOL> desc = """<STR_LIT>""" <EOL> check_negative ( desc , caffe_pb2 . TEST ) <EOL> def test_error_ref_unknown_blob ( self ) : <EOL> desc = """<STR_LIT>""" <EOL> check_negative ( desc , caffe_pb2 . TRAIN ) <EOL> def test_error_ref_unincluded_blob ( self ) : <EOL> desc = """<STR_LIT>""" <EOL> check_negative ( desc , caffe_pb2 . TEST ) <EOL> def test_error_ref_excluded_blob ( self ) : <EOL> desc = """<STR_LIT>""" <EOL> check_negative ( desc , caffe_pb2 . TEST ) </s>
