danbider / lightning-pose

Accelerated pose estimation and tracking using semi-supervised convolutional networks.
MIT License
235 stars 34 forks source link

fail to generate heatmaps for the video #108

Closed Di-Wang-AIND closed 1 year ago

Di-Wang-AIND commented 1 year ago

Hi, thanks for releasing lightning-pose. 

I got an error message when generating the heatmaps for the testing video by calling the export_predictions_and_labeled_video() function, from https://github.com/danbider/lightning-pose/blob/6135e5a50523d4a9d8f1ba986b76e28e3dcd0cf1/scripts/train_hydra.py. The error message is shown as below.

 export_predictions_and_labeled_video(                 video_file=video_file,                 cfg=cfg,                 ckpt_file=best_ckpt,                 prediction_csv_file=prediction_csv_file,                 labeled_mp4_file=labeled_mp4_file,                 trainer=trainer,                 model=model,                 data_module=data_module_pred,                 save_heatmaps=cfg.eval.get(                     "predict_vids_after_training_save_heatmaps", True                 ),             )   Error message: Traceback (most recent call last):   File "/root/capsule/scratch/lightning-pose/scripts/train_hydra.py", line 297, in train     export_predictions_and_labeled_video(   File "/lightning-pose/lightning_pose/utils/scripts.py", line 675, in export_predictions_and_labeled_video     preds_df = predict_single_video(   File "/lightning-pose/lightning_pose/utils/predictions.py", line 397, in predict_single_video     keypoints, confidences, heatmaps = _predict_frames(   File "/lightning-pose/lightning_pose/utils/predictions.py", line 437, in _predict_frames     def _predict_frames(   File "/opt/conda/lib/python3.8/site-packages/typeguard/_functions.py", line 113, in check_argument_types     check_type_internal(value, expected_type, memo=memo)   File "/opt/conda/lib/python3.8/site-packages/typeguard/_checkers.py", line 680, in check_type_internal     raise TypeCheckError(f"is not an instance of {qualified_name(origin_type)}") typeguard.TypeCheckError: argument "model" (lightning_pose.models.heatmap_tracker.HeatmapTracker) is not an instance of pytorch_lightning.core.module.LightningModule

Thanks, Di

themattinthehatt commented 1 year ago

thanks @Di-Wang-AIND i've already fixed this, just need to make a test, will be wrapped up today