facebookresearch / facebookresearch/detectron2
RuntimeError: Expected object of scalar type long int but got scalar type float for sequence element 1.
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
(densepose2) wag@wag-SYS-7049GP-TRT:/home/ssl/ssl/detectron2/projects/DensePose$ python apply_net.py show configs/densepose_rcnn_R_50_FPN_s1x.yaml densepose_rcnn_R_50_FPN_s1x.pkl image.jpg dp_contour,bbox --output image_densepose_contour.png
** fvcore version of PathManager will be deprecated soon. **
** Please migrate to the version in iopath repo. **
https://github.com/facebookresearch/iopath
** fvcore version of PathManager will be deprecated soon. **
** Please migrate to the version in iopath repo. **
https://github.com/facebookresearch/iopath
Traceback (most recent call last):
File "apply_net.py", line 345, in
main()
File "apply_net.py", line 341, in main
args.func(args)
File "apply_net.py", line 100, in execute
cls.execute_on_outputs(context, {"file_name": file_name, "image": img}, outputs)
File "apply_net.py", line 276, in execute_on_outputs
image_vis = visualizer.visualize(image, data)
File "/home/ssl/ssl/detectron2/projects/DensePose/densepose/vis/base.py", line 186, in visualize
image = visualizer.visualize(image, data[i])
File "/home/ssl/ssl/detectron2/projects/DensePose/densepose/vis/densepose_results.py", line 25, in visualize
iuv_array = torch.cat((result.labels[None], result.uv * 255.0)).type(torch.uint8)
**RuntimeError: Expected object of scalar type long int but got scalar type float for sequence element 1.**
Contributor guide
Research direction
Start by running the command shown in apply_net.py, then trace the visualization path into densepose/vis/base.py and densepose/vis/densepose_results.py, especially line 25. Compare the tensor inputs at the failing torch.cat call and verify the command completes while producing image_densepose_contour.png without the RuntimeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100