Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------
- TypeError Traceback (most recent call last)
- <ipython-input-5-1822e9eddf08> in <module>()
- 8 return (glob_dist_in,ref_img_fullres)
- 9
- ---> 10 (glob_dist_ref,ref_img_fullres) = get_global_histogram(ref_path)
- 11 img_pred = cid.net_forward(input_ab,input_mask,glob_dist_ref);
- 12 img_pred_withref_fullres = cid.get_img_fullres()
- <ipython-input-5-1822e9eddf08> in get_global_histogram(img_path)
- 4 img_glob_dist = (255*caffe.io.resize_image(ref_img_fullres,(Xd,Xd))).astype('uint8') # load image
- 5 gt_glob_net.blobs['img_bgr'].data[...] = img_glob_dist[:,:,::-1].transpose((2,0,1)) # put into
- ----> 6 gt_glob_net.forward();
- 7 glob_dist_in = gt_glob_net.blobs['gt_glob_ab_313_drop'].data[0,:-1,0,0].copy()
- 8 return (glob_dist_in,ref_img_fullres)
- /home/tranvick/tmp/caffe/python/caffe/pycaffe.pyc in _Net_forward(self, blobs, start, end, **kwargs)
- 129 self.blobs[in_].data[...] = blob
- 130
- --> 131 self._forward(start_ind, end_ind)
- 132
- 133 # Unpack blobs to extract
- /home/tranvick/interactive-deep-colorization/caffe_files/caffe_datalayers.py in forward(self, bottom, top)
- 53
- 54 def forward(self, bottom, top):
- ---> 55 top[0].data[...] = self.nnenc.encode_points_mtx_nd(bottom[0].data[...],axis=1)
- 56
- 57 def backward(self, top, propagate_down, bottom):
- /home/tranvick/interactive-deep-colorization/caffe_files/color_quantization.pyc in encode_points_mtx_nd(self, pts_nd, axis, returnSparse)
- 471 P = pts_flt.shape[0]
- 472
- --> 473 (dists,inds) = self.nbrs.kneighbors(pts_flt)
- 474
- 475 pts_enc_flt = np.zeros((P,self.K))
- /usr/local/lib/python2.7/dist-packages/sklearn/neighbors/base.pyc in kneighbors(self, X, n_neighbors, return_distance)
- 379 delayed(self._tree.query, check_pickle=False)(
- 380 X[s], n_neighbors, return_distance)
- --> 381 for s in gen_even_slices(X.shape[0], n_jobs)
- 382 )
- 383 if return_distance:
- /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/parallel.pyc in __call__(self, iterable)
- 756 # was dispatched. In particular this covers the edge
- 757 # case of Parallel used with an exhausted iterator.
- --> 758 while self.dispatch_one_batch(iterator):
- 759 self._iterating = True
- 760 else:
- /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/parallel.pyc in dispatch_one_batch(self, iterator)
- 606 return False
- 607 else:
- --> 608 self._dispatch(tasks)
- 609 return True
- 610
- /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/parallel.pyc in _dispatch(self, batch)
- 569 dispatch_timestamp = time.time()
- 570 cb = BatchCompletionCallBack(dispatch_timestamp, len(batch), self)
- --> 571 job = self._backend.apply_async(batch, callback=cb)
- 572 self._jobs.append(job)
- 573
- /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/_parallel_backends.pyc in apply_async(self, func, callback)
- 107 def apply_async(self, func, callback=None):
- 108 """Schedule a func to be run"""
- --> 109 result = ImmediateResult(func)
- 110 if callback:
- 111 callback(result)
- /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/_parallel_backends.pyc in __init__(self, batch)
- 324 # Don't delay the application, to avoid keeping the input
- 325 # arguments in memory
- --> 326 self.results = batch()
- 327
- 328 def get(self):
- /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/parallel.pyc in __call__(self)
- 129
- 130 def __call__(self):
- --> 131 return [func(*args, **kwargs) for func, args, kwargs in self.items]
- 132
- 133 def __len__(self):
- sklearn/neighbors/binary_tree.pxi in sklearn.neighbors.ball_tree.BinaryTree.query (sklearn/neighbors/ball_tree.c:11505)()
- sklearn/neighbors/binary_tree.pxi in sklearn.neighbors.ball_tree.NeighborsHeap.__init__ (sklearn/neighbors/ball_tree.c:5573)()
- TypeError: 'float' object cannot be interpreted as an index
Advertisement
Add Comment
Please, Sign In to add comment