You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
i.e.,
# b is a 28x3x224x224 matrix of float 32sout=net.forward_all(**{net1.inputs[0]:b})
Out[1]:
{'loss3/estimator': array([[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502],
[-0.33872247],
[-0.38100502]], dtype=float32)}
As 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:
class_GPUMgr(caffe.Net):
def__init__(self, model_file, pretrained_file):
''' model_file : the caffe model to use pretrained_file : array of model weights '''caffe.Net.__init__(self, model_file, pretrained_file, caffe.TEST)
in_=self.inputs[0]
self.image_dims=np.array(self.blobs[in_].data.shape[1:])
def__call__(self, data_array):
''' Actually executes the prediction, provided with an N x 3 x H x W array of N images that have already been preprocessed and resized. '''logging.debug('Running chunk of %i images on GPU'% (
data_array.shape[0]))
iftype(data_array).__module__!=np.__name__:
raiseTypeError("data_array type is %s, must be %s"% (
str(type(data_array)), str(np.__name__)))
ifdata_array.dtype!=np.dtype('float32'):
raiseValueError("data_array must be float32")
ifnp.any(data_array.shape[1:] !=self.image_dims):
raiseValueError(
"data_array must have shape N x %i x %i x %i"% (
self.image_dims[0], self.image_dims[1], self.image_dims[2]))
out=self.forward_all(**{self.inputs[0]: data_array})
predictions=np.exp(out[self.outputs[0]])
returnlist(predictions[:,0])
(the values above were not obtained by the __call__() function, and hence were not exponentiated)
The text was updated successfully, but these errors were encountered:
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:
i.e.,
As 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:
(the values above were not obtained by the
__call__()
function, and hence were not exponentiated)The text was updated successfully, but these errors were encountered: