Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 'NoneType' object has no attribute 'shape' #115

Open
vgilabert94 opened this issue Jun 15, 2019 · 1 comment
Open

Error 'NoneType' object has no attribute 'shape' #115

vgilabert94 opened this issue Jun 15, 2019 · 1 comment

Comments

@vgilabert94
Copy link

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

@Deeptanshu-sankhwar
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants