keras_Realtime_Multi-Person_Pose_Estimation icon indicating copy to clipboard operation
keras_Realtime_Multi-Person_Pose_Estimation copied to clipboard

Error 'NoneType' object has no attribute 'shape'

Open vgilabert94 opened this issue 5 years ago • 1 comments

Hi, Ive tried to test the algorithom but always recieve the same error:

python demo_image.py --image \sample_images\ski.jpg Using TensorFlow backend. start processing... Traceback (most recent call last): File "demo_image.py", line 258, in canvas = process(input_image, params, model_params) File "demo_image.py", line 36, in process multiplier = [x * model_params['boxsize'] / oriImg.shape[0] for x in params['scale_search']] File "demo_image.py", line 36, in multiplier = [x * model_params['boxsize'] / oriImg.shape[0] for x in params['scale_search']] AttributeError: 'NoneType' object has no attribute 'shape'

And calling video:

python demo_video.py --video \videos\sample1.mp4 Using TensorFlow backend. start processing... warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:808) warning: videos/\videos\sample1.mp4 (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:809) Traceback (most recent call last): File "demo_video.py", line 290, in out = cv2.VideoWriter(video_output,fourcc, output_fps, (input_image.shape[1], input_image.shape[0])) AttributeError: 'NoneType' object has no attribute 'shape'

Somebody know how can I solve this?

Thanks

vgilabert94 avatar Jun 15 '19 17:06 vgilabert94

@vgilabert94 for the file demo_video.py, use : python demo_video.py --video \sample1.mp4 because in line 38 and 39 of demo_video.py 38: video_path = 'videos' 39: video_file = video_path + video

Thus, if argument is passed '\videos\sample1.mp4' instead of '\sample1.mp4', video_file is read as 'videos\videos\sample1.mp4', a faulty location hence NoneType for the video object.

Deeptanshu-sankhwar avatar Oct 17 '19 17:10 Deeptanshu-sankhwar