{"action":"created","issue":{"url":"https://api.github.com/repos/BVLC/caffe/issues/3155","labels_url":"https://api.github.com/repos/BVLC/caffe/issues/3155/labels{/name}","comments_url":"https://api.github.com/repos/BVLC/caffe/issues/3155/comments","events_url":"https://api.github.com/repos/BVLC/caffe/issues/3155/events","html_url":"https://github.com/BVLC/caffe/issues/3155","id":109915731,"number":3155,"title":"Caffe returns different values for same input repeated","user":{"login":"eriophora","id":6423093,"avatar_url":"https://avatars.githubusercontent.com/u/6423093?v=3","gravatar_id":"","url":"https://api.github.com/users/eriophora","html_url":"https://github.com/eriophora","followers_url":"https://api.github.com/users/eriophora/followers","following_url":"https://api.github.com/users/eriophora/following{/other_user}","gists_url":"https://api.github.com/users/eriophora/gists{/gist_id}","starred_url":"https://api.github.com/users/eriophora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eriophora/subscriptions","organizations_url":"https://api.github.com/users/eriophora/orgs","repos_url":"https://api.github.com/users/eriophora/repos","events_url":"https://api.github.com/users/eriophora/events{/privacy}","received_events_url":"https://api.github.com/users/eriophora/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-06T00:58:03Z","updated_at":"2015-10-06T18:08:39Z","closed_at":null,"body":"I'm not sure if this is Caffe, or something I'm doing, but it's concerning. I'm using pycaffe. While debugging, I happened to run a block of 28 images, 224x224x3 each, all identical (i.e., the same values). The outputs of my net (based on GoogLeNet) oscillates:\r\n\r\ni.e.,\r\n```python\r\n# b is a 28x3x224x224 matrix of float 32s\r\nout = net.forward_all(**{net1.inputs[0]:b})\r\n\r\nOut[1]:\r\n{'loss3/estimator': array([[-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502],\r\n        [-0.33872247],\r\n        [-0.38100502]], dtype=float32)}\r\n```\r\n\r\nAs you can see, the values oscillate between -0.38100502 and -0.33872247. Anyone have any idea why this is occuring / has observed it in the past? The net is instantiated as:\r\n\r\n```python\r\nclass _GPUMgr(caffe.Net):\r\n    def __init__(self, model_file, pretrained_file):\r\n        '''\r\n        model_file : the caffe model to use\r\n        pretrained_file : array of model weights\r\n        '''\r\n        caffe.Net.__init__(self, model_file, pretrained_file, caffe.TEST)\r\n        in_ = self.inputs[0]\r\n        self.image_dims = np.array(self.blobs[in_].data.shape[1:])\r\n\r\n    def __call__(self, data_array):\r\n        '''\r\n        Actually executes the prediction, provided with an\r\n        N x 3 x H x W array of N images that have already\r\n        been preprocessed and resized.\r\n        '''\r\n        logging.debug('Running chunk of %i images on GPU' % (\r\n            data_array.shape[0]))\r\n        if type(data_array).__module__ != np.__name__:\r\n            raise TypeError(\"data_array type is %s, must be %s\" % (\r\n                str(type(data_array)), str(np.__name__)))\r\n        if data_array.dtype != np.dtype('float32'):\r\n            raise ValueError(\"data_array must be float32\")\r\n        if np.any(data_array.shape[1:] != self.image_dims):\r\n            raise ValueError(\r\n                \"data_array must have shape N x %i x %i x %i\" % (\r\n                self.image_dims[0], self.image_dims[1], self.image_dims[2]))\r\n        out = self.forward_all(**{self.inputs[0]: data_array})\r\n        predictions = np.exp(out[self.outputs[0]])\r\n        return list(predictions[:,0])\r\n```\r\n\r\n(the values above were not obtained by the `__call__()` function, and hence were not exponentiated)"},"comment":{"url":"https://api.github.com/repos/BVLC/caffe/issues/comments/145949344","html_url":"https://github.com/BVLC/caffe/issues/3155#issuecomment-145949344","issue_url":"https://api.github.com/repos/BVLC/caffe/issues/3155","id":145949344,"user":{"login":"eriophora","id":6423093,"avatar_url":"https://avatars.githubusercontent.com/u/6423093?v=3","gravatar_id":"","url":"https://api.github.com/users/eriophora","html_url":"https://github.com/eriophora","followers_url":"https://api.github.com/users/eriophora/followers","following_url":"https://api.github.com/users/eriophora/following{/other_user}","gists_url":"https://api.github.com/users/eriophora/gists{/gist_id}","starred_url":"https://api.github.com/users/eriophora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eriophora/subscriptions","organizations_url":"https://api.github.com/users/eriophora/orgs","repos_url":"https://api.github.com/users/eriophora/repos","events_url":"https://api.github.com/users/eriophora/events{/privacy}","received_events_url":"https://api.github.com/users/eriophora/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T18:08:39Z","updated_at":"2015-10-06T18:08:39Z","body":"I am, and that is very interesting thank you!"}}