Skip to content
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

Can I use it on CPU? #375

Open
wangzishuo2002 opened this issue Mar 15, 2022 · 0 comments
Open

Can I use it on CPU? #375

wangzishuo2002 opened this issue Mar 15, 2022 · 0 comments

Comments

@wangzishuo2002
Copy link

Dear Author,
Sorry to bother you, but i truly met a question that I can't solved.
When i run webcam.py on MacOS(only has cpu, and I have trained the weight on other server), it shows as below:

/Users/wangzishuo/FCOS-master/bin/python /Users/wangzishuo/Desktop/FCOS-master/demo/webcam.py
/Users/wangzishuo/FCOS-master/lib/python3.7/site-packages/torch/functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /Users/distiller/project/pytorch/aten/src/ATen/native/TensorShape.cpp:2228.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Traceback (most recent call last):
File "/Users/wangzishuo/Desktop/FCOS-master/demo/webcam.py", line 80, in
main()
File "/Users/wangzishuo/Desktop/FCOS-master/demo/webcam.py", line 71, in main
composite = coco_demo.run_on_opencv_image(img)
File "/Users/wangzishuo/Desktop/FCOS-master/demo/predictor.py", line 93, in run_on_opencv_image
predictions = self.compute_prediction(image)
File "/Users/wangzishuo/Desktop/FCOS-master/demo/predictor.py", line 126, in compute_prediction
predictions = self.model(image_list)
File "/Users/wangzishuo/FCOS-master/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/Users/wangzishuo/Desktop/FCOS-master/fcos_core/modeling/detector/generalized_rcnn.py", line 50, in forward
proposals, proposal_losses = self.rpn(images, features, targets)
File "/Users/wangzishuo/FCOS-master/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/Users/wangzishuo/Desktop/FCOS-master/fcos_core/modeling/rpn/fcos/fcos.py", line 164, in forward
centerness, images.image_sizes
File "/Users/wangzishuo/Desktop/FCOS-master/fcos_core/modeling/rpn/fcos/fcos.py", line 181, in _forward_test
centerness, image_sizes
File "/Users/wangzishuo/FCOS-master/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/Users/wangzishuo/Desktop/FCOS-master/fcos_core/modeling/rpn/fcos/inference.py", line 137, in forward
boxlists = self.select_over_all_levels(boxlists)
File "/Users/wangzishuo/Desktop/FCOS-master/fcos_core/modeling/rpn/fcos/inference.py", line 150, in select_over_all_levels
result = boxlist_ml_nms(boxlists[i], self.nms_thresh)
File "/Users/wangzishuo/Desktop/FCOS-master/fcos_core/structures/boxlist_ops.py", line 55, in boxlist_ml_nms
keep = _box_ml_nms(boxes, scores, labels.float(), nms_thresh)
RuntimeError: CPU version not implemented

Could you please tell me how to use it correctly on cpu? Thanks a lot!
maybe has some problem with fcos_core/csrc/ml_nms.h, but it's too complicated and i don't know how to change the c++ code to let it run on cpu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant