ValueError: Error when checking : expected input_1 to have 4 dimensions, but got array with shape
原因:预测的时候给的是数组,需要转成array。正确的写法:emotion_classifier=load_model("weights_best_simple_model.h5")t1=time.time()image=cv2.imdecode(np.fromfile('0.jpg',dtype=np.uint8),-1)#loadtheimage,pre-processit,andstorei