在执行如下程序时:
reshape_frames = np.zeros(video_all_frames.shape[0],224,224,video_all_frames.shape[3])
发生如下错误:
TypeError: zeros() takes at most 3 arguments (4 given)
原因分析:
zeros函数定义为()
zeros(shape, dtype=float, order='C')
一重括号会使系统认为依次给 hape, dtype=float, order=‘C’ 赋值。
所以应为两重括号
reshape_frames = np.zeros((video_all_frames.shape[0],224,224,video_all_frames.shape[3]))