when I use sliding_patch.ipynb
from caffe.classifier import Classifier
model_def = "/home/zsx/deep-learning-traffic-lights-master/model/deploy.prototxt"
model_weights = "/home/zsx/deep-learning-traffic-lights-master/model/train_squeezenet_trainval_manual_p2__iter_3817.caffemodel"
c = Classifier(
model_def,
model_weights,
mean=np.array([104, 117, 123]),
raw_scale=255,
channel_swap=(2,1,0),
image_dims=(256, 256))
set batch size
BATCH_SIZE = 64
c.blobs['data'].reshape(BATCH_SIZE, 3, c.blobs['data'].shape[2], c.blobs['data'].shape[3])
c.blobs['prob'].reshape(BATCH_SIZE, 3)
c.reshape()
def class_idx_to_name(idx):
return ['none', 'red', 'green'][idx]
[I 21:58:49.510 NotebookApp] KernelRestarter: restarting kernel (1/5)
WARNING:root:kernel 09a50faf-6028-42f2-8e9b-3294050616e8 restarted
My ipython on the restart, which is why?