@staticmethod
    def net_sanity_check(net, phase):
        assert phase == caffe_pb2.TRAIN or phase == caffe_pb2.TEST, "Unknown phase: %s" % repr(phase)
        # work out which layers and tops are included at the specified phase
        layers = []
        tops = []
        for layer in net.layer:
            if len(layer.include)>0:
                mask = 0 # include none by default
                for rule in layer.include:
                    mask = mask | (1<<rule.phase)
            elif len(layer.exclude)>0:
                # include and exclude rules are mutually exclusive as per Caffe spec
                mask = (1<<caffe_pb2.TRAIN) | (1<<caffe_pb2.TEST) # include all by default
                for rule in layer.exclude:
                    mask = mask & ~(1<<rule.phase)
            else:
                mask = (1<<caffe_pb2.TRAIN) | (1<<caffe_pb2.TEST)
            if mask & (1<<phase):
                # layer will be included at this stage
                layers.append(layer)
                tops.extend(layer.top)
        # add inputs
        tops.extend(net.input)
        # now make sure all bottoms are present at this stage
        for layer in layers:
            for bottom in layer.bottom:
                if bottom not in tops:
                    raise CaffeTrainSanityCheckError("Layer '%s' references bottom '%s' at the %s stage however " \
                                                     "this blob is not included at that stage. Please consider " \
                                                     "using an include directive to limit the scope of this layer." % (
                                                       layer.name, bottom, "TRAIN" if phase == caffe_pb2.TRAIN else "TEST"))
To get a list of projects, run **GET** against */api/projects/* as authenticated user.
dataset/ETHPy150Open NVIDIA/DIGITS/digits/model/tasks/caffe_train.py/CaffeTrainTask.net_sanity_check--crossover with--dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/structure/views.py/ProjectViewSet.list