You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DensePose_CSE KeyError: "Could not find converter from <class 'densepose.structures.cse.DensePoseEmbeddingPredictorOutput'> to <class 'densepose.structures.chart_result.DensePoseChartResultWithConfidences'>"
#4525
Open
sword-shadow opened this issue
Sep 5, 2022
· 4 comments
DensePose_CSE KeyError: "Could not find converter from <class 'densepose.structures.cse.DensePoseEmbeddingPredictorOutput'> to <class 'densepose.structures.chart_result.DensePoseChartResultWithConfidences'>"
create a virtual environment and install the required libraries
cd detectron2/projects/DensePose
python apply_net.py show configs/cse/densepose_rcnn_R_50_FPN_DL_soft_s1x.yaml model_final_9199f5.pkl image.png dp_contour,bbox --output image_densepose_contour.png
3. KeyError was reported
The checkpoint state_dict contains keys that are not used by the model:
pixel_mean
pixel_std
~/anaconda3/envs/densepose/lib/python3.7/site-packages/torch/functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1659484809535/work/aten/src/ATen/native/TensorShape.cpp:2894.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Traceback (most recent call last):
File "apply_net.py", line 354, in <module>
main()
File "apply_net.py", line 350, in main
args.func(args)
File "apply_net.py", line 106, in execute
cls.execute_on_outputs(context, {"file_name": file_name, "image": img}, outputs)
File "apply_net.py", line 284, in execute_on_outputs
data = extractor(outputs)
File "~/Projects/detectron2/projects/DensePose/densepose/vis/extractor.py", line 152, in __call__
data = extractor(instances, select)
File "~/Projects/detectron2/projects/DensePose/densepose/vis/extractor.py", line 102, in __call__
results = [converter.convert(dpout[i], boxes_xyxy[[i]]) for i in range(len(dpout))]
File "~/Projects/detectron2/projects/DensePose/densepose/vis/extractor.py", line 102, in <listcomp>
results = [converter.convert(dpout[i], boxes_xyxy[[i]]) for i in range(len(dpout))]
File "~/Projects/detectron2/projects/DensePose/densepose/converters/to_chart_result.py", line 65, in convert
predictor_outputs, boxes, *args, **kwargs
File "~/Projects/detectron2/projects/DensePose/densepose/converters/base.py", line 83, in convert
raise KeyError(f"Could not find converter from {instance_type} to {output_type_str}")
KeyError: "Could not find converter from <class 'densepose.structures.cse.DensePoseEmbeddingPredictorOutput'> to <class 'densepose.structures.chart_result.DensePoseChartResultWithConfidences'>"
Code Checking
I found that, in the detectron2/projects/DensePose/densepose/converters/base.py, _lookup_converter function returns None because there are only keys of <class 'densepose.structures.chart.DensePoseChartPredictorOutput'> in cls.registry, how can I modify this file to make the return result correct?
# the key-values in cls.registry using print function to output
{<class 'densepose.structures.chart.DensePoseChartPredictorOutput'>: <function densepose_chart_predictor_output_to_result_with_confidences at 0x7fb445a66dd0>}
{<class 'densepose.structures.chart.DensePoseChartPredictorOutput'>: <function densepose_chart_predictor_output_to_result_with_confidences at 0x7fb445a66dd0>}
You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template.
The following information is missing: "Instructions To Reproduce the Issue and Full Logs";
sword-shadow
changed the title
Please read & provide the following
DensePose_CSE bug - KeyError: "Could not find converter from <class 'densepose.structures.cse.DensePoseEmbeddingPredictorOutput'> to <class 'densepose.structures.chart_result.DensePoseChartResultWithConfidences'>"
Sep 5, 2022
sword-shadow
changed the title
DensePose_CSE bug - KeyError: "Could not find converter from <class 'densepose.structures.cse.DensePoseEmbeddingPredictorOutput'> to <class 'densepose.structures.chart_result.DensePoseChartResultWithConfidences'>"
DensePose_CSE KeyError: "Could not find converter from <class 'densepose.structures.cse.DensePoseEmbeddingPredictorOutput'> to <class 'densepose.structures.chart_result.DensePoseChartResultWithConfidences'>"
Sep 5, 2022
DensePose_CSE KeyError: "Could not find converter from <class 'densepose.structures.cse.DensePoseEmbeddingPredictorOutput'> to <class 'densepose.structures.chart_result.DensePoseChartResultWithConfidences'>"
3. KeyError was reported
Code Checking
I found that, in the detectron2/projects/DensePose/densepose/converters/base.py, _lookup_converter function returns None because there are only keys of <class 'densepose.structures.chart.DensePoseChartPredictorOutput'> in cls.registry, how can I modify this file to make the return result correct?
Environment:
The text was updated successfully, but these errors were encountered: