Tranvick

idc trace 3

May 18th, 2017
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.42 KB | None | 0 0
  1. ---------------------------------------------------------------------------
  2. TypeError                                 Traceback (most recent call last)
  3. <ipython-input-5-1822e9eddf08> in <module>()
  4.       8     return (glob_dist_in,ref_img_fullres)
  5.       9
  6. ---> 10 (glob_dist_ref,ref_img_fullres) = get_global_histogram(ref_path)
  7.      11 img_pred = cid.net_forward(input_ab,input_mask,glob_dist_ref);
  8.      12 img_pred_withref_fullres = cid.get_img_fullres()
  9.  
  10. <ipython-input-5-1822e9eddf08> in get_global_histogram(img_path)
  11.       4     img_glob_dist = (255*caffe.io.resize_image(ref_img_fullres,(Xd,Xd))).astype('uint8') # load image
  12.       5     gt_glob_net.blobs['img_bgr'].data[...] = img_glob_dist[:,:,::-1].transpose((2,0,1)) # put into
  13. ----> 6     gt_glob_net.forward();
  14.       7     glob_dist_in = gt_glob_net.blobs['gt_glob_ab_313_drop'].data[0,:-1,0,0].copy()
  15.       8     return (glob_dist_in,ref_img_fullres)
  16.  
  17. /home/tranvick/tmp/caffe/python/caffe/pycaffe.pyc in _Net_forward(self, blobs, start, end, **kwargs)
  18.     129             self.blobs[in_].data[...] = blob
  19.     130
  20. --> 131     self._forward(start_ind, end_ind)
  21.     132
  22.     133     # Unpack blobs to extract
  23.  
  24. /home/tranvick/interactive-deep-colorization/caffe_files/caffe_datalayers.py in forward(self, bottom, top)
  25.      53
  26.      54     def forward(self, bottom, top):
  27. ---> 55         top[0].data[...] = self.nnenc.encode_points_mtx_nd(bottom[0].data[...],axis=1)
  28.      56
  29.      57     def backward(self, top, propagate_down, bottom):
  30.  
  31. /home/tranvick/interactive-deep-colorization/caffe_files/color_quantization.pyc in encode_points_mtx_nd(self, pts_nd, axis, returnSparse)
  32.     471                 P = pts_flt.shape[0]
  33.     472
  34. --> 473                 (dists,inds) = self.nbrs.kneighbors(pts_flt)
  35.     474
  36.     475                 pts_enc_flt = np.zeros((P,self.K))
  37.  
  38. /usr/local/lib/python2.7/dist-packages/sklearn/neighbors/base.pyc in kneighbors(self, X, n_neighbors, return_distance)
  39.     379                 delayed(self._tree.query, check_pickle=False)(
  40.     380                     X[s], n_neighbors, return_distance)
  41. --> 381                 for s in gen_even_slices(X.shape[0], n_jobs)
  42.     382             )
  43.     383             if return_distance:
  44.  
  45. /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/parallel.pyc in __call__(self, iterable)
  46.     756             # was dispatched. In particular this covers the edge
  47.     757             # case of Parallel used with an exhausted iterator.
  48. --> 758             while self.dispatch_one_batch(iterator):
  49.     759                 self._iterating = True
  50.     760             else:
  51.  
  52. /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/parallel.pyc in dispatch_one_batch(self, iterator)
  53.     606                 return False
  54.     607             else:
  55. --> 608                 self._dispatch(tasks)
  56.     609                 return True
  57.     610
  58.  
  59. /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/parallel.pyc in _dispatch(self, batch)
  60.     569         dispatch_timestamp = time.time()
  61.     570         cb = BatchCompletionCallBack(dispatch_timestamp, len(batch), self)
  62. --> 571         job = self._backend.apply_async(batch, callback=cb)
  63.     572         self._jobs.append(job)
  64.     573
  65.  
  66. /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/_parallel_backends.pyc in apply_async(self, func, callback)
  67.     107     def apply_async(self, func, callback=None):
  68.     108         """Schedule a func to be run"""
  69. --> 109         result = ImmediateResult(func)
  70.     110         if callback:
  71.     111             callback(result)
  72.  
  73. /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/_parallel_backends.pyc in __init__(self, batch)
  74.     324         # Don't delay the application, to avoid keeping the input
  75.     325         # arguments in memory
  76. --> 326         self.results = batch()
  77.     327
  78.     328     def get(self):
  79.  
  80. /usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/parallel.pyc in __call__(self)
  81.     129
  82.     130     def __call__(self):
  83. --> 131         return [func(*args, **kwargs) for func, args, kwargs in self.items]
  84.     132
  85.     133     def __len__(self):
  86.  
  87. sklearn/neighbors/binary_tree.pxi in sklearn.neighbors.ball_tree.BinaryTree.query (sklearn/neighbors/ball_tree.c:11505)()
  88.  
  89. sklearn/neighbors/binary_tree.pxi in sklearn.neighbors.ball_tree.NeighborsHeap.__init__ (sklearn/neighbors/ball_tree.c:5573)()
  90.  
  91. TypeError: 'float' object cannot be interpreted as an index
Advertisement
Add Comment
Please, Sign In to add comment