RNN-for-Human-Activity-Recognition-using-2D-Pose-Input icon indicating copy to clipboard operation
RNN-for-Human-Activity-Recognition-using-2D-Pose-Input copied to clipboard

Getting error while predicting on my own video.(On a similar network model)

Open Mohsin365 opened this issue 5 years ago • 0 comments
trafficstars

Error : InvalidArgumentError Traceback (most recent call last) in 50 sequence_start=(sequence_start+1)%32 51 ---> 52 result_prob=model.predict(sequence_arr,None) 53 y_class= result_prob.argmax(axis=-1) 54 label=LABELS[y_class[0]] InvalidArgumentError: Input to reshape is a tensor with 2048 values, but the requested shape has 524288 [[{{node dense_1/Reshape_2}}]]

Code Snippet : X_ = np.asarray(openpose_output, dtype=np.float32) X_ = X_[np.newaxis, :, :] X_=X_.reshape(X_.shape[0],X_.shape[1],X_.shape[2]*X_.shape[3]) sequence_arr=np.append(X_[:,sequence_start:,:],X_[:,:sequence_start,:],axis=1) sequence_start=(sequence_start+1)%32

        result_prob=model.predict(sequence_arr,None)
        y_class= result_prob.argmax(axis=-1)
        label=LABELS[y_class[0]]
        print("Iterator::",iterator," Label ::",label)
        cv2.putText(frame, label, (50, 150), cv2.FONT_HERSHEY_COMPLEX, .8, (255, 50, 0),lineType=cv2.LINE_AA)

Mohsin365 avatar Jun 15 '20 15:06 Mohsin365