Comments (7)
Thanks guys! I did as @lsj910128 proposed and changed the lib/rpn/proposal_target_layer.py
to force the values to be integers. After modifying this, the training script worked! This is the summary of the changes I made:
- replace the for loop in line 532 with:
for ind in inds:
cls = clss[ind]
start = 4 * cls
end = start + 4
start = int(start)
end = int(end)
bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]
bbox_inside_weights[ind, start:end] = cfg.TRAIN.BBOX_INSIDE_WEIGHTS
- replace the if statement in line 579 with:
if fg_inds.size > 0:
fg_inds = npr.choice(fg_inds, size=int(fg_rois_per_this_image), replace=False)
- replace the if statement in line 590 with:
if bg_inds.size > 0:
bg_inds = npr.choice(bg_inds, size=int(bg_rois_per_this_image), replace=False)
- replace line 597 with:
labels[int(fg_rois_per_this_image):] = 0
- replace line 305 with:
roi_mask = -1 * np.ones((int(h), int(w)), dtype=np.float32)
- replace line 330 with:
mask_overlap = np.zeros((int(y2o-y1o), int(x2o-x1o)), dtype=np.float32)
- replace line 339 with:
mask_overlap_draw = color_img[int(y1o):int(y2o), int(x1o):int(x2o), :]
- replace line 347 with:
mask_overlap[:, :] = gt_mask[int(y1o):int(y2o), int(x1o):int(x2o)]
- replace line 352 with:
roi_mask[int(y1o-y1):int(y2o-y1), int(x1o-x1):int(x2o-x1)] = mask_overlap
from affordance-net.
I have had this problem before. Because I have no root user rights, so I directly change the code in rpn/proposal_target_layer.py", line 305
roi_mask = -1 * np.ones((int(h), int(w)), dtype=np.float32)
There are another places need to be change in the rpn/proposal_target_layer.py
from affordance-net.
You can manually convert the float indexes to integers. If it works, then it's ok.
from affordance-net.
This is a numpy version problem. I guess you're using version > 1.11.2, which doesn't support float index.
A quick fix is just to install numpy 1.11.2: sudo pip install numpy==1.11.2
, then you don't have to change anything in the code.
from affordance-net.
You can fix the float index problem by converting the indexes to integer.
Or without root, you can try pip install numpy==1.11.2 --user
. It will be installed on your local system, and there is no need to change the code :)
from affordance-net.
@nqanh Thanks a lot! It's a good means to solve this problem. You always can give us good advice!
from affordance-net.
@nqanh I did 'pip install numpy==1.11.2
' but it doesn't work
if i did 'pip install numpy==1.11.2'
then error message is
ImportError: numpy.core.multiarray failed to import
so, I reinstall >1.11 numpy then error message is
TypeError: slice indices must be integers or None or have an index method
so I fixed the code, then it worked
Could I solve this problem?
My environment is
anaconda2
python2.7.12
ubuntu14
cuda8.0
cudnn5.1
from affordance-net.
Related Issues (20)
- What is the difference between roi_alignment and roi_alignment2? HOT 2
- A question about .sm file HOT 6
- way to calculate F score HOT 6
- Regarding cudnn version and caffe installation HOT 5
- Sorry, Can you tell me how to create several .sm files in image with pascal voc datasets?
- A question about loss_mask layer
- I get some errors while doing python demo_img.py HOT 1
- src/caffe/layers/cudnn_relu_layer.cu(19): error: identifier "activ_desc_" is undefined HOT 2
- Add cudnn7 support
- How to create several .sm files in an image with pascal voc datasets?
- Camera parameters of IIT dataset HOT 1
- Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type HOT 2
- How to change number of classes
- WARNING: filter_boxes() remove ALL proposal.
- One Object with multiple affordances
- Missing Affordance Masks
- Ros version Problem
- Color-coded affordance label HOT 2
- Caffe Installation
- AffordanceNet architecture implementation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from affordance-net.