-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the problem of caffe_traininglayers.py #33
Comments
I solved. |
@crazyzsy I have got the same error. can you post the solution of it? |
I changed line 313 to explicitly pick the int member and not the fp parameter: |
I still couldn't find the error. Can you please post the exact changes? |
@crazyzsy @TerisGH Could you please post your solutions. |
In newer versions sklearn.neighbors.NearestNeighbors needs to be initialized with an integer, |
Thanks, I made the corresponding change. |
Hi, we take our own color image data set to train the model.but we encounter a question,which is your caffe_traininglayers.py. When running ./train/train_model.sh, I got the following error:
TypeError: 'float' object cannot be interpreted as an index
.As follows:I0612 09:26:00.048768 1935 caffe.cpp:221] Starting Optimization
I0612 09:26:00.048841 1935 solver.cpp:279] Solving LtoAB
I0612 09:26:00.048853 1935 solver.cpp:280] Learning Rate Policy: step
Traceback (most recent call last):
File "/home/joy/colorization-master/resources/caffe_traininglayers.py", line 72, in forward
top[0].data[...] = self.nnenc.encode_points_mtx_nd(bottom[0].data[...],axis=1)
File "/home/joy/colorization-master/resources/caffe_traininglayers.py", line 329, in encode_points_mtx_nd
(dists,inds) = self.nbrs.kneighbors(pts_flt)
File "/home/dpa/anaconda2/lib/python2.7/site-packages/sklearn/neighbors/base.py", line 399, in kneighbors
for s in gen_even_slices(X.shape[0], n_jobs)
File "/home/dpa/anaconda2/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py", line 800, in call
while self.dispatch_one_batch(iterator):
File "/home/dpa/anaconda2/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py", line 658, in dispatch_one_batch
self._dispatch(tasks)
File "/home/dpa/anaconda2/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py", line 566, in _dispatch
job = ImmediateComputeBatch(batch)
File "/home/dpa/anaconda2/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py", line 180, in init
self.results = batch()
File "/home/dpa/anaconda2/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py", line 72, in call
return [func(*args, **kwargs) for func, args, kwargs in self.items]
File "sklearn/neighbors/binary_tree.pxi", line 1310, in sklearn.neighbors.ball_tree.BinaryTree.query (sklearn/neighbors/ball_tree.c:10592)
File "sklearn/neighbors/binary_tree.pxi", line 588, in sklearn.neighbors.ball_tree.NeighborsHeap.init (sklearn/neighbors/ball_tree.c:4931)
TypeError: 'float' object cannot be interpreted as an index
Can anyone help me about this issue?
Thanks appreciately!
The text was updated successfully, but these errors were encountered: