tf-blazepose icon indicating copy to clipboard operation
tf-blazepose copied to clipboard

ValueError when running "run_video.py"

Open SAIL-LAB155 opened this issue 5 years ago • 0 comments

Hello. When I am running the webcam demo with "python run_video.py -c configs/mpii/config_blazepose_mpii_pushup_heatmap_bce_regress_huber.json -m blazepose_pushup_v1.h5 -v webcam --confidence 0.3", an error occurs:

**Traceback (most recent call last): File "run_video.py", line 45, in model = trainer.load_model(config, args.model) File "/home/hkuit155/Desktop/tf-blazepose/src/trainers/blazepose_trainer.py", line 162, in load_model model.compile() File "/home/hkuit155/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/base.py", line 457, in _method_wrapper result = method(self, *args, **kwargs) File "/home/hkuit155/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 446, in compile self._compile_weights_loss_and_weighted_metrics() File "/home/hkuit155/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/base.py", line 457, in _method_wrapper result = method(self, *args, kwargs) File "/home/hkuit155/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 1592, in _compile_weights_loss_and_weighted_metrics self.total_loss = self._prepare_total_loss(masks) File "/home/hkuit155/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 1691, in _prepare_total_loss raise ValueError('The model cannot be compiled ' ValueError: The model cannot be compiled because it has no loss to optimize.

It seems that the model needs to be trained before running with webcam. And the error appears when training begins. Are there any solutions for it? I am looking forward to your reply. Thans you so much.

SAIL-LAB155 avatar Dec 29 '20 07:12 SAIL-LAB155